Concept Flow - Sieve of Eratosthenes Find All Primes
Initialize array of size n+1 with True
Set 0 and 1 as False
Start with p = 2
Is p * p <= n?
No→End
|Yes
If array[p
Mark multiples of p as False
Increment p by 1
↩Back to check p * p <= n
Start with all numbers marked prime, then repeatedly mark multiples of each prime as not prime until reaching sqrt(n).
