Primes forever
The question
2, 3, 5, 7, 11, 13, … The primes get rarer as the numbers grow. Do they ever run out? And how rare do they get?
Try the experiment before reading on. There’s no wrong way to explore.
Experiment
The Sieve of Eratosthenes
Cross out the multiples of each prime in turn. The numbers that are never crossed out are the primes.
- prime
- crossed out
Step 1 of 7
Here are the numbers from 1 to 120. Press “Next step” to start sieving.
Hints, if you want them
What’s going on
What’s going on
Euclid's argument, from the Elements (Book IX, Proposition 20), shows the primes never run out. Take any finite list of primes and form . Dividing by any leaves remainder , so no prime on the list divides . But has at least one prime factor. That prime is not on the list — so no finite list contains every prime.
How rare are they? There are primes below , below and below a million. Gauss and Legendre guessed, and Hadamard and de la Vallée Poussin proved in 1896, the prime number theorem: the number of primes up to is approximately , in the sense that the ratio tends to .
Primes can be far apart: are consecutive numbers with no prime among them. Are there also infinitely many twin primes like and ? Nobody knows. In 2013 Yitang Zhang proved that infinitely many pairs of primes differ by at most million, and collaborative work soon lowered the bound to — but the twin prime conjecture itself remains open, as does the Riemann hypothesis, which would pin down the error in the prime number theorem.
Note
The sieve in the experiment checks small numbers exactly; it cannot reach infinity. Euclid's argument can.
Where this leads
- Grades 9–12 · Lesson availableDivisibility, Euclid's algorithm and unique factorisationDivisibility of integers, greatest common divisors, Euclid's algorithm, Bézout's identity and a proof of the fundamental theorem of arithmetic.
- Advanced undergraduate · Lesson availableNumber theoryPrimitive roots, quadratic residues and quadratic reciprocity, arithmetic functions and Möbius inversion, sums of two squares and Pell's equation.
- First-year graduate · Lesson availableAnalytic number theoryPrimes through the lens of analysis: arithmetic functions and Dirichlet series, the Riemann zeta function and its Euler product, analytic continuation and the functional equation, the prime number theorem, Dirichlet characters and primes in arithmetic progressions, and the Riemann hypothesis as an open problem.