🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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?

  1. A.Because primes are always below √n
  2. B.Because even numbers are never prime
  3. C.If n = a × b, at least one of a and b must be ≤ √n
  4. 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 →