← Quiz: Number Theory for Coding: all 10 questions
Quiz: Number Theory for Coding · Question 3 of 10
To check whether n is prime, why is it enough to try divisors up to √n?
To check whether n is prime, why is it enough to try divisors up to √n?
- A.Because primes are always below √n
- B.Because even numbers are never prime
- C.If n = a × b, at least one of a and b must be ≤ √n
- D.Because √n is always a whole number
Answer & explanation
Correct answer: If n = a × b, at least one of a and b must be ≤ √n
If both factors were larger than √n, their product would exceed n.
Can you get the rest right without peeking?
Take the timed Quiz: Number Theory for Coding quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →