Why it happens
Why the Primes Never Run Out
Multiply any list of primes and add 1. Every listed prime leaves remainder 1 when it divides the result, so the primes that do divide it are missing from the list. No finite list holds them all. For the first six primes the number is 30,031, which isn't prime: it's 59 × 509, two primes the list missed.
The Sieve of Eratosthenes, 1 to 400
- CH1 known so far
- CH2 n / ln n
How to read the stage
- Objective
- Read the grid and the chart, and say why the sieve can stop once the next prime's square passes 400.
- How this step gets you there
- The text walks the first and last steps of the default run and names what each panel counts.
The grid holds 1 to 400. Each step takes the next number still standing, marks it prime, and crosses out its multiples from its square up, the new ones in red. 2 alone crosses out 199. After 19, the next prime is 23, and 23 × 23 = 529 is past 400, so the 78 numbers still standing are all prime. The chart counts them against n / ln n.
Euclid's proof, run on a list
- Objective
- Explain why the product of a list of primes, plus 1, always has a prime factor that isn't on the list.
- How this step gets you there
- The stage builds the number from a list you pick, divides it by each listed prime, then factors it.
Euclid's Elements, Book IX, Proposition 20, says that prime numbers are more than any assigned multitude of prime numbers. Take the first six primes: their product is 30,030, so 30,031 leaves remainder 1 when divided by each of them. A listed prime that divided 30,031 would also divide that 1. So every prime that divides 30,031 is new, here 59 and 509. Any list works the same way.
Euclid's proof on the first six primes
Product plus one isn't always prime
- Objective
- Correct the claim that Euclid's product plus 1 is always prime, and say what the proof needs instead.
- How this step gets you there
- The table under the second stage factors the product plus 1 for the first one to eight primes.
It's tempting to read the proof as saying the product plus 1 is itself a new prime. For the first one to five primes it is: 3, 7, 31, 211 and 2,311. For the first six it's 30,031 = 59 × 509, and for the first seven, 510,511 = 19 × 97 × 277. The proof only needs its prime factors to be off the list. Whether infinitely many of these numbers are prime is still unknown.
A direct proof, often told as a contradiction
- Objective
- Tell Euclid's original argument apart from the retelling that starts by assuming finitely many primes.
- How this step gets you there
- The text sets the common retelling against Euclid's own steps, in translation, and a historian's survey.
Many accounts, MacTutor's among them, call Euclid's proof a contradiction: suppose finitely many primes, multiply them, add 1. Euclid's own text, in David Joyce's translation, starts from any assigned primes A, B and C and finds one more; its only appeal to absurdity is the step showing the new prime isn't A, B or C. Romeo Meštrović's survey both uses and doubts the label. Either way, the argument builds a new prime from any list.
Eratosthenes' sieve
- Objective
- Say where the sieve comes from and how it lists primes without testing any number for divisibility.
- How this step gets you there
- The text gives the sieve's history from its sources, then ties it back to the crossing out on the stage.
The sieve is named for Eratosthenes of Cyrene, a third-century BC scholar who became librarian at Alexandria. The earliest known description is in Nicomachus of Gerasa's Introduction to Arithmetic, from the late first or early second century AD, which credits the sieve to him. It lists every prime up to a limit with no division at all: only counting along by each prime and crossing out.
How thin the primes get
- Objective
- Compare the sieve's prime counts with n / ln n and say what the prime number theorem claims.
- How this step gets you there
- The bars under the hero show the count divided by n / ln n at four limits, from the sieve's own runs.
The primes thin out but never stop. Up to 400 the sieve finds 78, where n / ln n gives 66.8. Up to 100,000 it finds 9,592 against 8,685.9, and the ratio falls from 1.161 at 1,000 to 1.104 at 100,000. The prime number theorem, proved independently by Jacques Hadamard and Charles de la Vallée Poussin in 1896, says the ratio tends to 1. Legendre and Gauss had both come to this density long before.
What the model leaves out
- Objective
- Say what running examples can and can't show, and where trial division and n / ln n stop being useful.
- How this step gets you there
- The text separates what the stage checks from what the theorems prove.
The stage proves nothing by running. It checks one list at a time and sieves only to 100,000; the proof covers every finite list at once. Trial division finds 59 in 30,031 fast, but its work grows with the square root of the number, so it is far too slow for numbers hundreds of digits long. And n / ln n is the theorem's simplest form, not its closest estimate.
Questions
- Is the product of primes plus one always prime?
- No. 2 × 3 × 5 × 7 × 11 × 13 + 1 = 30,031 = 59 × 509. The first five such numbers, 3, 7, 31, 211 and 2,311, are prime, and the sixth isn't. Euclid's argument only needs every prime factor of the number to be missing from the list, and that is always true.
- How many primes are there below 100, 1,000 or a million?
- 25 below 100, 168 below 1,000, 1,229 below 10,000, 9,592 below 100,000 and 78,498 below a million. Each count is above n / ln n: 1.151 times it at 100 and 1.104 times it at 100,000.
- Who proved there are infinitely many primes?
- Euclid, in Book IX of the Elements, written around 300 BC. He states it without the word infinite: prime numbers are more than any assigned multitude of prime numbers. Many other proofs have followed; Romeo Meštrović's survey collects 200 of them.
- Why does the sieve start crossing out at the square of each prime?
- Any multiple of a prime p below p × p, other than p, is p times a number from 2 to p − 1, which has a prime factor smaller than p, so an earlier pass crossed it out. For the same reason the sieve can stop once p × p passes the limit: up to 400 the last prime it uses is 19.