Correctness of the Sieve of Eratosthenes
Statement
An integer is prime if and only if it is not divisible by any prime .
Why is it true?
This equivalence is exactly what lets the sieve stop early: once every prime up to has crossed off its multiples, there is no possible witness left to convict any remaining number of being composite, so testing (or crossing off) larger primes is provably wasted work.
Proof sketch
() Suppose has no prime factor . If were composite, write with . Then (otherwise and would force , a contradiction), and 's smallest prime factor satisfies , so is a prime factor of that is — contradicting the hypothesis. So has no such factorization, hence is prime.
() If is prime, its only positive divisors are and ; no prime divides it at all, so in particular none with does either.
Together these show the two conditions are equivalent, which is exactly the termination criterion used in the sieve: after processing every prime up to , everything still unmarked in satisfies the right-hand side, hence is prime.
Topics that use this theorem
Step-by-step proofs
No step-by-step proof yet for this theorem.
References
- Alina Carmen Cojocaru, M. Ram Murty (2005). An Introduction to Sieve Methods and Their Applications
- Yitang Zhang (2014). Bounded gaps between primes · DOI:10.4007/annals.2014.179.3.7
- James Maynard (2015). Small gaps between primes · DOI:10.4007/annals.2015.181.1.7