The Infinitude of Primes

Primes are the atoms of the number system — every whole number bigger than 1 is built by multiplying primes together, and in only one way (that's the Fundamental Theorem of Arithmetic). So a natural question follows immediately: do we ever run out of atoms?

As you climb the number line, primes get rarer. Between 1 and 100 there are 25 of them; between 10{,}000{,}000 and 10{,}000{,}100 there are typically only one or two. Vast empty deserts open up with no primes at all — the gap between consecutive primes can be made bigger than any number you name. It would be entirely reasonable to guess that, somewhere far up the number line, the very last prime is sitting alone, with nothing but composites beyond it. Every whole number system we build — clocks, codes, cryptography — leans on primes never actually giving out. Euclid settled the question over two thousand years ago, with an argument so short and so clean that it is still, essentially unchanged, one of the very first pieces of "real" mathematics most people ever meet.

Euclid's proof

There are infinitely many prime numbers.

The argument is a proof by contradiction: assume the opposite of what we want, and show that assumption collapses. Suppose, for the sake of argument, that there were only finitely many primes in existence — every last one of them. Then we could write them all down in a complete, finite list:

p_1,\ p_2,\ \dots,\ p_k.

Now build one carefully chosen number by multiplying every prime on that list and adding one:

N = p_1 p_2 \cdots p_k + 1.

By the Fundamental Theorem of Arithmetic, N has some prime factor p (every integer bigger than 1 does). But look at what happens when you divide N by any prime on our list: dividing p_1 p_2 \cdots p_k by p_i leaves no remainder, so dividing N = p_1 p_2 \cdots p_k + 1 by p_i always leaves remainder 1 — never 0. So p, the prime factor we just found, cannot be any of p_1, \dots, p_k.

We have just produced a prime that is missing from a list that was supposed to be every prime. That's the contradiction. The only thing that could have gone wrong is our starting assumption — so there cannot be a finite list of all the primes. The primes never run out.

This isn't just an abstract curiosity, either. The whole idea of using primes to lock up information — the encryption that protects a bank card number flying across the internet — depends on there always being fresh, unpredictable primes available, no matter how large a number you need. If the primes ever ran dry, that whole toolbox would eventually break. Euclid's proof is the ultimate guarantee behind it: the supply never, ever ends.

A worked example: catching the argument in the act

The proof works for any finite list, no matter how it was chosen — that's exactly its power. To see it up close, pretend someone hands you a short "complete" list of primes:

\{2,\ 3,\ 5\}.

Multiply them together and add one:

N = 2 \cdot 3 \cdot 5 + 1 = 31.

Check the remainders directly: 31 = 2 \times 15 + 1, so dividing by 2 leaves remainder 1; likewise 31 = 3 \times 10 + 1 and 31 = 5 \times 6 + 1. Not one of 2, 3, 5 divides 31 exactly. And indeed, 31 itself turns out to be prime — a brand new prime, sitting completely outside the list \{2,3,5\}. Whoever claimed that list was "all the primes" was wrong the moment we exhibited 31. Feed the proof any finite list whatsoever — a thousand primes, a million — and the same trick manufactures a witness that the list was incomplete. That is the whole engine of the theorem, running on three small numbers.

A second try, with a slightly longer starting list, shows the same trick doesn't get any weaker as the list grows. Take \{2, 3, 5, 7\}:

N = 2 \cdot 3 \cdot 5 \cdot 7 + 1 = 211.

Check divisibility by each prime on the list in turn — 211 is odd, not a multiple of 3 (its digits sum to 4), doesn't end in 0 or 5, and 211 = 7\times 30 + 1. None of 2, 3, 5, 7 divides it, and in fact 211 is itself prime — a fifth prime the list \{2,3,5,7\} never mentioned. Compare that with the very next example below, where Euclid's number comes out composite instead: either way, a brand new prime gets exposed.

It's tempting to walk away thinking "multiply the primes you have, add one, and you get the next prime." That is a common — and wrong — reading of the proof. Try it with the first six primes:

2\cdot 3\cdot 5\cdot 7\cdot 11\cdot 13 + 1 = 30031 = 59 \times 509.

30031 is not prime — it's composite, the product of 59 and 509. The proof never promised N itself would be prime. All it promised is that some prime factor of N — here, either 59 or 509 — is missing from the original list \{2,3,5,7,11,13\}, and both of them are. That missing factor is the "new" prime the proof guarantees; it is usually hiding inside N's factorisation, not sitting there as N itself.

A contradiction, not a formula

There's a second trap right next to the first one: Euclid's argument is not a recipe for generating primes. A proof by contradiction only needs to show that assuming "finitely many primes" leads somewhere impossible — it doesn't need to hand you an efficient way to actually find the new prime. Notice what the proof does and doesn't give you:

So Euclid's theorem answers a pure existence question — "do the primes ever stop?" — with a resounding no, while staying completely silent on the much harder practical question of how to list them. Existence proofs like this one are common throughout mathematics: they settle whether something is out there without necessarily saying how to go and get it.

Inexhaustible, but thinning

Infinitely many, yes — but they do thin out, and Euclid's proof says nothing at all about how fast. That quantitative question — roughly how many primes lie below a given size — is far subtler and far deeper, and it drives the rest of this stage and, ultimately, the Prime Number Theorem, which pins down that thinning-out rate precisely.

It's worth seeing just how empty those "prime deserts" can get, precisely because it makes Euclid's guarantee feel more surprising, not less. Pick any number of empty steps you like, say n = 6, and look at these five numbers in a row:

6! + 2,\ \ 6! + 3,\ \ 6! + 4,\ \ 6! + 5,\ \ 6! + 6,

where 6! = 720. Every single one is composite: 720+2=722 is divisible by 2 (because 720 and 2 both are), 720+3=723 is divisible by 3 (because 720 and 3 both are), and so on up to 720+6=726, divisible by 6. That's a run of five consecutive numbers with no prime among them — and the same trick with a bigger factorial n! builds a prime-free run as long as you like, anywhere you like. Deserts of any length are guaranteed to exist. And yet Euclid's theorem guarantees, with equal certainty, that no matter how far out you travel, the desert always ends and another prime is waiting on the other side. Both facts are true at once — arbitrarily long gaps, and an endless supply — and that tension is exactly what makes the deeper study of prime distribution so rich.

Euclid wrote this argument down roughly 2,300 years ago, in Book IX, Proposition 20 of his Elements — and it has needed essentially no repair since. No calculus, no computer, no heavy machinery: just multiplication, addition, and a flash of contradiction. The great 20th-century mathematician G. H. Hardy, in his famous essay A Mathematician's Apology, singled out this very proof (alongside the irrationality of \sqrt{2}) as one of the finest examples of real mathematical beauty — "a rate of exchange" between the amount of thought poured in and the size of the truth won back, he argued, that is hard to beat anywhere in the subject. Two millennia of mathematics later, textbooks still present it almost word for word as Euclid first set it out.

Part of the beauty is how little it assumes. Euclid didn't need to know anything special about which primes were on the list, how big they were, or how they were chosen — the argument swallows any finite list whatsoever and spits out a contradiction every time. Compare that with proofs that grind through cases or need heavy calculation: this one is closer to a magic trick that works because of the structure of the numbers involved, not their particular values. That is often the mark of a truly elegant proof — and it's why generations of students meet this exact argument as their first taste of what a rigorous mathematical proof can feel like.

People have tried. Start with p_1 = 2. Multiply the primes found so far, add one, and take the smallest prime factor of the result as the next term:

p_1 = 2,\quad p_2 = 3,\quad p_3 = 7,\quad p_4 = 43,\quad p_5 = 13,\ \dots

(Check the last step: 2\cdot 3\cdot 7\cdot 43 + 1 = 1807 = 13 \times 139, and 13 is the smaller factor.) This is the real Euclid–Mullin sequence, named after the mathematician who first wrote it down in 1963. It is a genuine, well-defined procedure for generating an endless stream of distinct primes — so in a narrow sense the proof can be turned into a machine. But it is a wildly impractical one: nobody knows a simple formula for its terms, some early terms have needed serious computing power just to factor, and — remarkably — nobody has proved whether every prime eventually shows up somewhere in the sequence. A two-line existence proof, and mathematicians still can't fully tame the very sequence it inspired.