Number

There is no last prime

Euclid's argument is often described as producing a new prime from any finite list. It does not, and the number it builds is frequently composite — which makes the proof more interesting rather than less.

Worth reading first: The primes are what is left over.

The primes thin out. Below a hundred there are twenty-five of them; between nine hundred and a thousand there are fourteen; between a million and a million and a hundred, six. A reader watching that trend and expecting it to reach zero somewhere would be making an entirely reasonable extrapolation from the evidence, and would be wrong.

Euclid's construction on 2, 3, 5, 7. The product of the listed primes plus one, divided by each of them in turn; every division leaves one over.
Fig. 1 Multiply a list of primes together and add one. Each bar shows the product divided into blocks by one of the listed primes: the blocks tile the product exactly, and then meet the extra unit, which no whole block can cover. Every listed prime therefore leaves a remainder of one, and the generator computes those remainders rather than asserting them.

That is Euclid’s argument, from Book IX of the Elements, and it is about as old as the sieve. It is one of a small number of proofs that have been in continuous use for twenty-three centuries without anybody improving on them.

The picture is the whole of it. The product 2×3×5×7=2102 \times 3 \times 5 \times 7 = 210 is divisible by each of its factors — that is what a product is — so each of them tiles it with nothing left over. Adding one leaves each of them with a remainder of exactly one. So 211211 is divisible by none of 2,3,5,72, 3, 5, 7; and since every number above one has at least one prime factor, 211211’s prime factors are not on the list.

Any finite list of primes therefore fails to be all of them. There is no last prime.

What the argument does not say

Euclid’s proof is regularly described, in textbooks and in conversation, as a machine for producing new primes: take the primes so far, multiply, add one, and out comes a prime. It says nothing of the sort, and the difference matters.

Euclid's construction on 2, 3, 5, 7, 11, 13. The product of the listed primes plus one, divided by each of them in turn; every division leaves one over.
Fig. 2 The same construction on the first six primes. The product is 30,03030{,}030 and the number built is 30,03130{,}031, which is not prime: it is 59×50959 \times 509. Both factors are new, which is all the argument ever claimed.

30,03130{,}031 is composite, and it is the first case where this happens. The products 33, 77, 3131, 211211 and 23112311 are all prime; the sixth is not. Anybody testing the “machine” by hand would have checked five cases, found five primes, and formed a confident and false general belief — which is exactly the failure mode this collection keeps running into, and the reason a handful of small cases is not a sample of the cases.

What the argument actually establishes is weaker and quite sufficient: the constructed number has some prime factor, and that factor is not on the list. Whether the constructed number is itself prime is a separate question that Euclid never asks, and the proof does not become shaky when the answer is no.

The divisors of 30. Every divisor as a lattice point, one axis per prime, joined when one divides the other by a single prime.
Fig. 3 The divisors of 2×3×52 \times 3 \times 5, one axis per prime. A primorial is the extreme case of a divisor lattice: every exponent is one, so the lattice is a cube and every divisor is a choice of subset of the primes. The eight corners are the eight subsets.

That cube is the reason the construction works so cleanly. Every divisor of a primorial above one contains at least one of the listed primes, so every divisor above one is caught by the remainder argument. Adding one steps off the lattice entirely — the result shares no factor with any corner of it — and the only place its prime factors can live is outside the list. The picture makes “coprime to the product” and “coprime to every factor at once” the same statement, which is exactly the step the proof turns on.

There is a small warning attached. A larger list makes a larger cube, and the cube’s corners are the numbers the argument rules out; they are not the numbers between the primes. The construction never claims to have found the next prime, and in the six-prime case the new primes it finds, 5959 and 509509, sit far below the number that produced them.

The distinction is between an existence proof and a construction, and it recurs everywhere. The pigeonhole principle proves that two things share a box without saying which two. Euclid’s argument proves that a new prime exists without saying what it is. Both are complete proofs; neither hands over an object.

The contradiction that is not needed

Euclid’s version is sometimes given as a proof by contradiction: suppose the primes are finite, form their product, add one, and derive an absurdity. It reads well and it is not what Book IX says.

The original is a direct statement. Given any three primes, a fourth exists that is none of them. No supposition, no contradiction, no infinite set anywhere in the argument — the proposition is about extending a finite list, and Euclid states it that way because the Greek mathematical vocabulary had no comfortable way to speak of a completed infinity.

That turns out to be the better version. It is constructive in the logician’s sense: it takes a finite list of primes and produces a number that must contain a new one, and running the process gives an explicit, if absurdly inefficient, way to generate primes forever. The proof-by-contradiction dressing adds nothing and obscures that.

Modern practice has drifted back towards Euclid. Where the two forms are equally available, the direct one is preferred — not out of foundational scruples but because a direct proof gives an algorithm and a contradiction gives only a fact.

Other proofs, and what each one costs

The result is important enough to have been proved many times over, and comparing the proofs says more about the subject than any of them says alone.

Euler’s, from around 1737, is analytic. If there were finitely many primes, the product

∏p(1−1p)−1\prod_p \left(1 - \frac{1}{p}\right)^{-1}

would be a finite product of finite numbers, hence finite. Expanding each factor as a geometric series and multiplying out gives every reciprocal 1/n1/n exactly once — by unique factorisation — so the product equals ∑1/n\sum 1/n, and the harmonic series diverges. A finite product cannot equal an infinite sum, so there are infinitely many primes.

This is a great deal more machinery for the same conclusion, and it repays the cost immediately. Euler’s argument does not merely show there are infinitely many primes; it shows that ∑1/p\sum 1/p itself diverges, so the primes are substantially infinite — much commoner than the squares, whose reciprocals converge. Euclid’s argument cannot see the difference.

The sieve as a product, and the sum over the primes. The whole numbers up to 60, with those built only from 2, 3, 5 marked — the numbers the product of three geometric series multiplies out to. Beside them, the sum of the reciprocals of the primes, which grows without bound.
Fig. 4 The identity and its consequence, both measured. On the left, the numbers that 22, 33 and 55 build: multiplying three truncated geometric series gives 3.4666673.466667, which is exactly the sum of the reciprocals of the 6464 marked numbers — the expansion Euler’s argument performs, done on three primes where every term can be checked. On the right, what the same identity yields when every prime is used: ∑1/p\sum 1/p up to xx, which passes 2.712.71 at a hundred thousand and never leaves ln⁡ln⁡x+0.261\ln\ln x + 0.261 by more than 0.0650.065. It diverges, and it does so about as slowly as a divergent sum can.
π(x) below 2000. A staircase counting the primes, with x over the natural logarithm of x beside it.
Fig. 5 How many primes there are below each bound, counted off the sieve. Euclid’s argument guarantees only that this staircase never stops climbing. Euler’s says how steeply: the reciprocals of the steps add up to infinity, which is a much stronger statement than “there are always more”.

The gap between those two claims is the gap between the two eras of the subject. For two thousand years the primes were an object of exact, finite reasoning: an argument either produced a new prime or it did not. Euler’s identity brings a limit into a question about divisibility and gets an answer nobody could have reached by counting, and everything afterwards — the prime number theorem, the zeta function, the Riemann hypothesis — is downstream of that single move. The whole apparatus exists because somebody was willing to write down an infinite product of things that have no business being multiplied together.

Goldbach’s needs no analysis at all. The Fermat numbers Fn=22n+1F_n = 2^{2^n} + 1 satisfy F0F1⋯Fn−1=Fn−2F_0 F_1 \cdots F_{n-1} = F_n - 2, so any common factor of two of them divides 22 — and they are all odd. Infinitely many pairwise coprime numbers means infinitely many primes.

Fürstenberg’s, from 1955, is topological: put a topology on the integers in which arithmetic progressions are open, observe that each is also closed, and note that the complement of the union of the progressions pZp\mathbb{Z} is {−1,1}\{-1, 1\}, which is not open. If there were finitely many primes, that union would be closed and its complement open. It is a genuine argument and it is Euclid’s argument in a costume — the topology is a way of saying “coprime” — but it is a good illustration of how far a statement can be moved before it stops working.

Counting squarefree numbers, and how weak Euclid’s bound is

A qualitative proof can usually be squeezed for a quantitative statement, and squeezing these two is the fastest way to see how far apart they are.

Euclid’s, squeezed. The construction says the next prime is at most the product of the ones before it, plus one. Running that as a recursion from the start gives a bound on the nn-th prime of 22 raised to the power 2n−12^{n-1} — a tower that doubles its exponent at every step. Turned round, it says the count of primes below xx grows at least like the logarithm of the logarithm of xx.

That is a genuine theorem and it is comically weak. It guarantees perhaps ten primes below a number with a hundred digits. Nothing is wrong with the proof; the bound is loose because the construction throws away the primes it does not use, and it throws away almost all of them.

Erdős’s proof, from 1938, is a counting argument and does far better. Every whole number splits uniquely as a square times a squarefree number. Suppose the primes up to NN are kk in total. A squarefree number below NN is a product of some subset of those kk primes, so there are at most 2k2^k of them; a square below NN has a root below the square root of NN, so there are at most N\sqrt{N} of those. Every number up to NN is one of each, so

N≤2kN,N \le 2^k \sqrt{N},

which rearranges to say that 2k2^k is at least N\sqrt{N} — so the number of primes below NN is at least half the base-two logarithm of NN.

That is a logarithm rather than a logarithm of a logarithm, and the gap between the two is the difference between a bound that is useless at any size and one that is merely loose. Below a million it guarantees ten primes; the truth is 78,498. Below 1010010^{100} it guarantees a hundred and sixty-odd, which is still nothing like the truth and is a great deal more than Euclid’s ten.

And the method is the one this collection keeps meeting. Nothing in Erdős’s argument is about primes as such: it counts one set of objects two ways, gets an inequality, and reads a conclusion off the inequality. It never constructs a prime, never assumes finiteness for contradiction, and never touches an infinite series. What it uses is unique factorisation and the observation that a subset of kk things has 2k2^k choices, which is the counting the divisor cube above draws.

So the proofs sit on a scale of what they buy. Euclid’s produces a prime and a bound too weak to use. Erdős’s produces no prime and a bound worth having. Euler’s produces neither and shows the primes are dense enough that their reciprocals diverge. Each pays more machinery for a stronger statement, and the qualitative conclusion — that the list never ends — is the cheapest thing any of them says.

What the picture cannot show

The bars in the first figure make the argument visible and hide its scale entirely. The product of the primes up to nn — the primorial — grows roughly like ene^n, so the numbers the construction produces get large immediately. The primorial of the primes up to 100100 has 3737 digits; the primorial up to 10001000 has 416416.

So the construction proves that primes keep arriving and gives no useful information about where. It says a prime exists somewhere between pkp_k and p1p2⋯pk+1p_1 p_2 \cdots p_k + 1, which is an interval of astronomical width. Bertrand’s postulate — proved by Chebyshev in 1852 — says something far stronger, that a prime always lies between nn and 2n2n, and it takes real work.

The figure also cannot show the thing the whole subject wants, which is regularity. The primes below a hundred can be drawn; the primes near 104010^{40} cannot be drawn, counted, or reasoned about individually, and the statements known about them are all statements about density. This is the same limitation the sieve’s staircase runs into: a picture of the beginning of the number line is a picture of the least representative part of it.

Where the gaps come from

There is one more thing the construction gives away, and it comes from reading the same picture backwards.

The numbers n!+2,n!+3,…,n!+nn! + 2, n! + 3, \ldots, n! + n are each divisible by 2,3,…,n2, 3, \ldots, n respectively, because n!n! contains every one of those factors and the added term supplies the rest. So they are all composite, and there is a run of n−1n - 1 consecutive composite numbers sitting somewhere near n!n!.

That is the same move as Euclid’s — build a number that every small prime divides, then step away from it by one — used to produce absence rather than presence. Adding one to the primorial escapes every small prime at once; adding kk to the factorial lands inside one of them deliberately. Gaps of every size exist, and the construction that shows it is the construction that shows there is no last prime, run in reverse.

The gaps between primes below 400. One bar per consecutive pair of primes, its height the distance between them.
Fig. 6 The gaps between consecutive primes below four hundred. The factorial construction says the tallest bar in this picture is not a ceiling and that no picture has one; what it does not say is where the tall bars are, and every bar here is short compared with what exists further out.

The two results sit oddly together. Euclid’s says the primes never run out; the factorial construction says they can be absent for as long as one likes. Both are elementary, both are constructive, and together they leave the actual behaviour completely open — a run of a million composites exists somewhere, and so does a prime after it. Between those two statements is where the entire modern subject lives, and neither of the arguments that produced them can say anything about the space between.

The shape of the argument

Strip the arithmetic away and what remains is a general move worth naming: to show a collection is not everything, build something that differs from each of its members in a way each member can detect.

Every prime on the list detects 210+1210 + 1 as not-its-multiple. That is precisely the structure of Cantor’s diagonal argument, which shows there are more real numbers than boxes to put them in by building a number differing from the nn-th in the nn-th place. The two proofs are separated by two thousand years and are recognisably the same idea: a candidate for completeness is defeated by an object constructed to disagree with every entry.

Euclid’s version has the advantage that the disagreement is arithmetic — a remainder of one — and can therefore be drawn. That is why the picture at the top of this essay is a picture of blocks and one leftover square, and why it carries the whole proof.

The same shape turns up a third time in a place with no numbers in it at all. To show that a list of essays does not cover a subject, write one that differs from each listed essay in a point that essay is about; to show that a set of axioms does not settle everything, build a statement that disagrees with each provable one. Gödel’s construction is the diagonal argument again, and its ancestry runs back through Cantor to the leftover square. What all three have in common is that the constructed object is specified by its disagreements rather than described directly — nobody has to know what 211211 factors into, only what it is not divisible by.

That is also why these arguments feel unsatisfying on first meeting. They end without producing the thing they are about, and the reader is left holding a certificate rather than an object. In this case the certificate is worth more than the object would be: one more prime is one more prime, and knowing that the list can never be finished is a fact about all of them at once.

The largest one anybody has written down

There being no last prime does not stop people from keeping a record of the largest one found, and the record has an unusual property: for almost the whole of the modern era it has been held by a number of one particular shape.

496 is perfect, because its divisors form this rectangle. Two rows of divisors: the powers of two, and the same powers multiplied by the Mersenne prime.
Fig. 7 25−1=312^5 - 1 = 31 is prime, and the rectangle of divisors it generates is a perfect number. Numbers of the form 2k−12^k - 1 are the Mersennes, and they are the reason the record for the largest known prime is not held by an arbitrary number.

The reason is a test rather than a coincidence. Deciding whether an arbitrary nn is prime is expensive; deciding whether 2k−12^k - 1 is prime has a special method, the Lucas–Lehmer test, which is fast enough that numbers with tens of millions of digits are within reach. Nothing similar exists for numbers in general, so the record goes to the shape that has the test.

That is worth sitting with. The largest known prime is not the largest prime anybody has looked near; it is the largest one in the only family that can be checked at that size. Whether infinitely many Mersenne numbers are prime is unknown, and it is one of the older open questions in the subject — a search that has run since Mersenne’s list of 1644, has found fifty-odd examples, and has never been able to say whether the fifty-first exists.

The same shape appears in the numbers that are the sum of their own parts, where the Mersenne primes turn out to generate every even perfect number and nothing else. Two questions that sound unrelated — how large a prime can be certified, and which numbers equal the sum of their divisors — turn out to be the same question, and the reason is the rectangle in the figure above.

Where the ladder goes next

The argument leans, quietly, on a fact used without comment: every number above one has a prime factor, and the factors of 30,03130{,}031 are what they are and not something else. That is unique factorisation, and it is worth proving rather than assuming.

The other direction is the one Euler opened. Knowing that the primes never stop is the beginning of asking how often they arrive, which is the sieve’s density question and eventually the prime number theorem. And the same style of argument — assume a solution, build a smaller one, and note that the process cannot continue — is what makes a square that cannot shrink impossible, which is the other classical proof everybody meets early and nobody forgets.

What links here

Computed from the collection, not written here: the essays that point at this one.

Reads more easily once this is understood

Essays that name this one as worth reading first.

Shares its objects with

Essays that name at least two of the same things, and that neither author linked.

Named objects

A dashed tag is an object no other essay names yet.

CompositeCounting argumentDivisibilityEuclidExistence proofHarmonic seriesPrimesPrimorialProof by contradiction