🎙 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 4 of 10

In the Sieve of Eratosthenes, why start crossing out multiples of p from p × p?

In the Sieve of Eratosthenes, why start crossing out multiples of p from p × p?

  1. A.Smaller multiples of p have a smaller prime factor and were already crossed out
  2. B.Because p × p is always prime
  3. C.To save memory
  4. D.Because 2p is never a multiple of p
Answer & explanation

Correct answer: Smaller multiples of p have a smaller prime factor and were already crossed out

For example 3 × 5 = 15 was already removed by 3 before we reach 5.

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 →