Where the waves go quiet
A book for anyone who can count

The Book of the
Quiet Waves

From counting on your fingers to the most famous unsolved problem in mathematics, one small step at a time.

Before we begin

How to read this book

This book assumes you know how to count, add and multiply. That is all. Everything else, every symbol and every strange word, gets explained the first time it appears, and again later if it has been a while.

The little numbers that float beside the text are footnotes.Like this one. On a wide screen the notes sit in the margin next to the line they belong to. On a phone, tap the number and the note opens right where you are. You can skip every single note and still follow the book. They are there for the curious, and occasionally for a joke. They hold extra detail, history, and the occasional warning about where a simple explanation cuts a corner.

Some pages have a figure you can play with. Press the buttons, drag the sliders. Mathematicians understand things by poking at them, and so can you.

Formulas look scary mostly because they are written in a compressed shorthand. Every time one appears, the sentence right after it says the same thing in plain words. If a formula ever stops you, read the sentence instead and carry on.

The whole book in one paragraph

Primes are the numbers that cannot be split into smaller factors. They look random, but how many there are below any point follows a smooth curve, and the wobbles around that curve are made of waves. Each wave comes from a special point, a zero, of one function called the Riemann zeta function. The Riemann hypothesis says all those points sit on one straight line. If it is true, the primes are as tidy as anything random can possibly be. Nobody has proved it since 1859.

Chapter 1

Building blocks

Take twelve marbles. You can lay them out as a neat rectangle in several ways: two rows of six, three rows of four, four rows of three. Now take thirteen marbles and try again. You can make one long row of thirteen, and that is it. Any other attempt leaves marbles poking out.

12 Change the number of marbles. When the only rectangle is a single row, the number is prime.

That is the whole idea of a prime number. Twelve can be built by multiplying smaller whole numbers, \(12 = 3 \times 4\). Thirteen cannot. The only way to write it as a product is \(13 = 1 \times 13\), which is not really building it from anything smaller.

Definition. A prime number is a whole number bigger than 1 whose only divisors are 1 and itself. A whole number bigger than 1 that is not prime is called composite.

A divisor of a number is any whole number that goes into it exactly, with nothing left over. The divisors of 12 are 1, 2, 3, 4, 6 and 12. The divisors of 13 are just 1 and 13.

So the primes begin

2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, …

and the composites begin 4, 6, 8, 9, 10, 12, 14, 15, 16, 18, … Notice that 2 is the only even prime, because every other even number has 2 as a divisor.This makes 2 "the oddest prime", a joke mathematicians have been telling for at least a century.

Why is 1 not a prime?

It fits the words "divisible only by 1 and itself" perfectly well, so why leave it out? Because of the most important fact about primes, which we meet next. If 1 counted as prime, that fact would become false, or at least clumsy to state.Until around 1900 some mathematicians did count 1 as a prime. The modern choice won because it makes nearly every theorem shorter. Definitions in mathematics are chosen to make true things easy to say.

Atoms of multiplication

Take any whole number bigger than 1 and keep breaking it into smaller factors until you cannot go any further. For 360:

\(360 = 36 \times 10 = (6 \times 6) \times (2 \times 5) = (2 \times 3)\times(2\times 3)\times 2\times 5 = 2^3 \times 3^2 \times 5.\)

The small raised numbers are exponents. \(2^3\) means \(2\times2\times2\), three twos multiplied together. Every number you break down this way ends up as a product of primes, because primes are exactly the numbers you cannot break any further.

Here is the remarkable part. It does not matter how you start breaking. Start with \(360 = 4\times 90\) or \(360 = 8 \times 45\) or anything else, and you always land on the same primes, the same number of times: three 2s, two 3s and one 5.

The Fundamental Theorem of Arithmetic

Every whole number bigger than 1 can be written as a product of primes in exactly one way, apart from the order of the factors.

This is why primes are called the atoms of arithmetic. Water is always two hydrogens and one oxygen; 360 is always three 2s, two 3s and a 5. The "exactly one way" is where 1 would cause trouble. If 1 were prime, you could write \(360 = 1 \times 2^3\times3^2\times5\) or \(1\times1\times2^3\times3^2\times5\), and the uniqueness would be lost.The theorem feels obvious, but it is not automatic. There are number systems where it fails. In numbers of the form \(a + b\sqrt{-5}\), the number 6 can be built as \(2\times3\) and also as \((1+\sqrt{-5})(1-\sqrt{-5})\), and none of those four pieces can be broken down further. Discovering this in the 1840s led to a whole new branch of algebra.

A factor tree: keep splitting 360 until only primes (circled) are left. Any route down ends with the same leaves.
Chapter 2

They never run out

If every number is built from primes, maybe a handful of primes is enough to build everything? Maybe after some huge number there are no new primes, and everything bigger is made from the old ones. About 2,300 years ago, Euclid of Alexandria showed that this never happens.It is Proposition 20 in Book IX of Euclid's Elements, written around 300 BC. It is one of the oldest proofs still taught in exactly its original spirit.

Euclid's argument, in plain words

Suppose someone hands you a list of primes and claims it is complete. Say the list is 2, 3, 5 and 7. Multiply them all together and add one:

\(N = 2\times3\times5\times7 + 1 = 211.\)

Now ask: which prime on the list divides \(N\)? Not 2, because \(2\times3\times5\times7\) is a multiple of 2, so \(N\) is one more than a multiple of 2 and leaves remainder 1. The same reasoning works for 3, for 5 and for 7. Every prime on the list leaves remainder 1.

But \(N\) is bigger than 1, so it is built from some primes. None of them are on the list. So the list was not complete. Here 211 happens to be prime itself. With the list 2, 3, 5, 7, 11, 13 you get \(30031 = 59 \times 509\), which is not prime, but 59 and 509 are new primes that were missing from the list.A common misunderstanding is that "the product plus one" is always prime. It is not, as 30031 shows. The argument only promises a prime that is missing from the list, either \(N\) itself or one of its factors.

Whatever finite list anyone writes down, this trick finds a prime that is missing from it. So the list of primes can never be finished. There are infinitely many primes.

Euclid's trick on the list 2, 3, 5, 7.
Why this kind of argument is so powerful. Notice we never had to find all the primes, or even a big one. We showed that the idea "this list is complete" leads to a contradiction. This style is called proof by contradiction, and it lets you know things about infinitely many objects by reasoning about one imaginary list.
Chapter 3

Finding them: the sieve

How do you find all the primes up to 100? Testing each number one by one is slow. Eratosthenes, a librarian at Alexandria who also measured the size of the Earth,Around 240 BC he compared the angle of the Sun's shadow at Syene and Alexandria on the same day and estimated the Earth's circumference to within a few percent of the true value, depending on which length of "stadion" he used. found a better way. Instead of hunting for primes, cross out everything that is not one.

  1. Write down the numbers from 2 to 100.
  2. The first number not crossed out is 2. It is prime. Cross out every multiple of 2 after it: 4, 6, 8, …
  3. The next number not crossed out is 3. It is prime. Cross out 6, 9, 12, …
  4. Next is 5 (4 is already gone). Cross out its multiples. Then 7.
  5. Stop. Whatever is left is prime.
Nothing crossed out yet.

Why can we stop at 7?

Because \(11 \times 11 = 121\) is already bigger than 100. If a number up to 100 were composite, it would have to have a factor no bigger than its square root.The square root of a number \(x\), written \(\sqrt{x}\), is the number that multiplied by itself gives \(x\). \(\sqrt{100} = 10\) because \(10\times10 = 100\). If \(n = a \times b\) and both \(a\) and \(b\) were bigger than \(\sqrt n\), their product would be bigger than \(n\). So one of them must be at most \(\sqrt n\). So once you have sieved out the multiples of every prime up to \(\sqrt{100} = 10\), any survivors must be prime.

This exact fact is what my "prime wave" in the film rediscovered by accident. Each prime \(p\) sends out a wave that rises at \(2p, 3p, 4p, \dots\) Laying all the waves on top of each other is the same as crossing out multiples. Where no wave arrives, the number is prime. With waves up to \(P\), the method is perfect up to \(P^2\) and then starts letting composites through, like 121 when you only use waves up to 7. It is the sieve, dressed up as physics.

The prime wave. Each prime sends a wave; where none arrives, the number is prime. Press play and watch it crack beyond P².from the film
Chapter 4

How the primes thin out

Among the first ten numbers, four are prime: 2, 3, 5, 7. Among the first hundred, 25 are. Among the first thousand, 168. The primes get rarer as you go, but slowly, and never stop.

Mathematicians give the counting a name. \(\pi(x)\), read "pi of x", means the number of primes up to x.This \(\pi\) has nothing to do with 3.14159… It is just the Greek letter p, for "prime". Mathematicians reuse letters shamelessly. So \(\pi(10) = 4\), \(\pi(100) = 25\), \(\pi(1000)=168\).

xprimes up to x, π(x)fraction that are primeone prime in every…
10440%2.5
1002525%4
1,00016816.8%6.0
10,0001,22912.3%8.1
100,0009,5929.6%10.4
1,000,00078,4987.8%12.7
1,000,000,00050,847,5345.1%19.7

Look at the last column. Each time \(x\) gets ten times bigger, the gap between primes grows by roughly the same amount, about 2.3. Something that goes up by a fixed step each time you multiply by ten has a name: a logarithm.

Logarithms in one minute

The logarithm answers the question "how many times do I multiply to get here?" Base-10 logarithms count factors of ten: \(\log_{10} 1000 = 3\) because \(10\times10\times10 = 1000\). It turns multiplying into adding, which is why it grows so slowly: going from a million to a billion only adds 3.

The natural logarithm, written \(\ln x\), does the same with a special number \(e \approx 2.71828\) in place of 10.\(e\) shows up whenever something grows in proportion to its own size, like compound interest added continuously. It is to growth what \(\pi\) is to circles. \(\ln x\) is just \(\log_{10} x\) times about 2.3026, which is exactly the "about 2.3" step we saw in the table. And here is the punchline: the typical gap between primes near \(x\) is about \(\ln x\). Near a million, \(\ln(1{,}000{,}000) \approx 13.8\), and the table says one prime in every 12.7. Close, and it gets closer the further you go.

The logarithm ladder.

Gauss's guess

Around 1792, a fifteen-year-old Carl Friedrich Gauss spent his free time counting primes in blocks of a thousandHe described this in a letter to Johann Encke in 1849, saying he had begun "very often spending an idle quarter of an hour to count another chiliad here and there". A chiliad is a block of a thousand numbers. and noticed exactly this pattern. If one number in \(\ln x\) is prime near \(x\), then up to \(x\) there should be about

\(\pi(x) \approx \dfrac{x}{\ln x}.\)

In words: the count of primes up to \(x\) is roughly \(x\) divided by its natural logarithm. Gauss later found an even better approximation, the logarithmic integral \(\mathrm{Li}(x)\), which adds up the chance \(1/\ln t\) of each number \(t\) being prime instead of using one average.Written out, \(\mathrm{Li}(x) = \int_2^x \frac{dt}{\ln t}\). The long S is an integral sign, which here just means "add up continuously". It is the smooth version of \(\frac1{\ln 2}+\frac1{\ln 3}+\frac1{\ln 4}+\dots+\frac1{\ln x}\). Up to a billion, \(\mathrm{Li}(x)\) is off by only 1,701 out of fifty million.

The Prime Number Theorem (1896)

As \(x\) grows, the ratio \(\pi(x) \div (x/\ln x)\) gets closer and closer to 1.

Gauss could not prove it. Neither could anyone else for a hundred years. It was finally proved in 1896 by Jacques Hadamard and Charles de la Vallée Poussin, independently, in the same year. Both proofs used the zeta function, which is where this book is heading. But first, a question that matters more than it looks: how wrong is the guess?

Counting primes: π(x) against Gauss's x / ln x and Li(x), from 100 up to 100,000.from the film

The error \(\pi(x) - \mathrm{Li}(x)\) wobbles up and down in a way that looks random. The Riemann hypothesis is, at heart, a statement about how big those wobbles can get. Keep that in mind. It is the thread that ties the whole book together.

Chapter 5

Patterns, real and imagined

Write the primes out and stare, and patterns seem to leap off the page. Some are real. Many are tricks of the eye. Learning to tell the two apart was the most valuable thing my three months taught me.

A real one: 6k ± 1

Every prime bigger than 3 is one more or one less than a multiple of 6: 5 and 7 surround 6, 11 and 13 surround 12, 17 and 19 surround 18. Why? Any whole number leaves a remainder of 0, 1, 2, 3, 4 or 5 when divided by 6. If the remainder is 0, 2 or 4, the number is even. If it is 3, the number is a multiple of 3. That leaves remainders 1 and 5, which is "one more than" or "one less than" a multiple of 6.This is modular arithmetic, the arithmetic of remainders, sometimes called clock arithmetic. On a 6-hour clock, 13 o'clock is 1 o'clock. Mathematicians write \(13 \equiv 1 \pmod 6\).

Be careful about the direction, though. Every prime above 3 is of the form \(6k\pm1\), but not every \(6k\pm1\) is prime: \(25 = 6\times4+1\) is not. The rule rules things out, it does not rule primes in. This one-way street fooled me more than once.

How often each gap between consecutive primes occurs.

Twins, cousins and gaps

Primes two apart, like 11 and 13 or 41 and 43, are called twin primes. Nobody knows whether there are infinitely many of them. In 2013 Yitang Zhang, then a little-known lecturer, proved that infinitely many pairs of primes are at most 70 million apart, and a worldwide online collaboration soon cut that to 246.The collaboration was the Polymath8 project, organised by Terence Tao and others, working in public on a blog. Getting from 246 down to 2 would prove the twin prime conjecture, and current methods cannot do it.

Gaps can also be enormous. The numbers \(n!+2, n!+3, \dots, n!+n\) are all composite,\(n!\), "n factorial", means \(1\times2\times3\times\dots\times n\). Since \(n!\) is a multiple of every number from 2 to \(n\), the number \(n!+k\) is a multiple of \(k\) for each \(k\) from 2 to \(n\). so there are runs of composites as long as you like.

Spirals

In 1963 Stanisław Ulam, doodling during a boring talk, wrote the numbers in a square spiral and circled the primes. They lined up along diagonals. In 1994 Robert Sacks did the same with a smooth spiral, putting \(n\) at distance \(\sqrt n\) from the centre, turning a full circle at every perfect square. Again the primes gather on curves.

The Sacks spiral of the first 20,000 numbers. Primes are bright. Every bright curve is a quadratic like Euler's \(n^2+n+41\).

These curves are real, but they are not a secret code. Each one is a formula like \(n^2 + n + 41\), which Euler noticed gives primes for \(n = 0, 1, \dots, 39\).At \(n = 40\) it gives \(1681 = 41^2\). No polynomial with whole-number coefficients can produce only primes forever. If it gives a prime \(p\) at some point, it gives a multiple of \(p\) again \(p\) steps later. Some formulas simply dodge small prime factors better than others, so they are rich in primes, and the spiral happens to draw those formulas as curves. The spiral is a window. The pattern belongs as much to the window as to the primes.

From the film: the Sacks spiral turns into the golden-angle spiral and then into Ulam's square spiral. Same primes, different windows.from the film
Chapter 6

Adding forever

To get from primes to the zeta function, we need one new idea: adding up infinitely many numbers. That sounds impossible, and sometimes it is. But sometimes the total settles down to a definite value.

Walk halfway to a wall, then half the remaining distance, then half again. You take infinitely many steps, but you never pass the wall:

\(\tfrac12 + \tfrac14 + \tfrac18 + \tfrac1{16} + \dots = 1.\)

We say the sum converges to 1: the more terms you add, the closer you get, as close as you like.Strictly, an infinite sum means the limit of its partial sums. "The sum is 1" means: for any tiny tolerance you name, after enough terms the running total stays within that tolerance of 1.

The harmonic series breaks the rule

Now try

\(1 + \tfrac12 + \tfrac13 + \tfrac14 + \tfrac15 + \dots\)

The terms shrink towards zero, so you might expect a finite total. But group them: \(\tfrac13+\tfrac14\) is more than \(\tfrac12\). \(\tfrac15+\tfrac16+\tfrac17+\tfrac18\) is more than \(\tfrac12\). The next eight terms are more than \(\tfrac12\) again. You can keep finding halves forever, so the total grows without limit. It diverges.This argument is from Nicole Oresme, around 1350. The growth is very slow: the sum of the first \(n\) terms is about \(\ln n + 0.5772\). To pass 100 you need around \(1.5\times10^{43}\) terms.

Grouping the harmonic series: each group of terms stacks up past ½.

Squares tame it

Square the bottoms and the sum calms down:

\(1 + \tfrac14 + \tfrac19 + \tfrac1{16} + \tfrac1{25} + \dots = \dfrac{\pi^2}{6} \approx 1.6449.\)

This is the famous Basel problem, solved by Leonhard Euler in 1734. It is astonishing: a sum built from whole numbers equals something built from \(\pi\), the circle number.Here \(\pi\) is back to meaning 3.14159…, the ratio of a circle's circumference to its diameter. Euler's first argument was daring and not fully rigorous. He treated \(\sin x / x\) as an infinite polynomial and factored it by its zeros. He made it rigorous later. Circles hiding inside whole numbers is a theme we will meet again.

The zeta function is born

Why stop at squares? Use any power \(s\):

The zeta function

\(\displaystyle \zeta(s) = 1 + \frac1{2^s} + \frac1{3^s} + \frac1{4^s} + \dots = \sum_{n=1}^{\infty} \frac{1}{n^s}\)

In words: raise every whole number to the power \(s\), flip each one upside down, and add them all.The big \(\Sigma\) is a capital Greek S, for "sum". \(\sum_{n=1}^\infty\) means "let \(n\) run through 1, 2, 3, … and add up what follows". \(\zeta\) is the Greek letter zeta. We just saw that \(\zeta(1)\) is infinite and \(\zeta(2) = \pi^2/6\). For any \(s\) bigger than 1 the sum converges. Euler also found \(\zeta(4) = \pi^4/90\) and kept going.

In my own notebook, adding cosine waves \(\cos(2\pi x/n)/n^2\) for every \(n\) gave me a mysterious constant term of \(\pi^2/6\). That was \(\zeta(2)\) showing up uninvited. It was my first meeting with this function.

Chapter 7

Euler's golden key

So far zeta is a sum over all whole numbers. What does it have to do with primes? In 1737 Euler found the link, and it is so beautiful that it is often called the golden key.

The Euler product

\(\displaystyle \sum_{n=1}^\infty \frac1{n^s} \;=\; \prod_{p \text{ prime}} \frac{1}{1 - p^{-s}} \;=\; \frac{1}{1-2^{-s}}\cdot\frac{1}{1-3^{-s}}\cdot\frac{1}{1-5^{-s}}\cdots\)

The left side involves every whole number. The right side involves only primes.The big \(\Pi\) is a capital Greek P, for "product": multiply everything that follows, one factor for each prime \(p\). And \(p^{-s}\) just means \(1/p^s\). They are equal. Here is why, with nothing but schoolroom algebra.

Why it works

Start with one fact about walk-to-the-wall sums: for any number \(r\) between 0 and 1,

\(1 + r + r^2 + r^3 + \dots = \dfrac{1}{1-r}.\)

(With \(r = \tfrac12\) that is \(1 + \tfrac12 + \tfrac14 + \dots = 2\).) So each prime's factor unfolds into

\(\dfrac{1}{1-2^{-s}} = 1 + \dfrac1{2^s} + \dfrac1{4^s} + \dfrac1{8^s} + \dots,\qquad \dfrac{1}{1-3^{-s}} = 1 + \dfrac1{3^s} + \dfrac1{9^s} + \dots\)

Now multiply all those brackets together. Each term of the result comes from picking one item from each bracket: say \(\tfrac1{2^s}\) from the 2-bracket, \(\tfrac1{3^s}\) from the 3-bracket, \(\tfrac1{5^s}\) from the 5-bracket, and 1 from all the rest. That gives \(\tfrac{1}{30^s}\). Picking \(\tfrac1{8^s}\) and \(\tfrac1{9^s}\) gives \(\tfrac1{72^s}\).

Every whole number appears, because every whole number is a product of primes. And each appears exactly once, because that product is unique. That is the Fundamental Theorem of Arithmetic from Chapter 1, doing the heavy lifting.Multiplying infinitely many brackets needs some care, but for \(s > 1\) everything converges nicely and the argument is completely rigorous.

A free bonus. Put \(s=1\). The left side is the harmonic series, which is infinite. If there were only finitely many primes, the right side would be a finite product of finite numbers. So there must be infinitely many primes. That is Euler's proof of Euclid's theorem, and it says more: the primes are common enough that \(\tfrac12+\tfrac13+\tfrac15+\tfrac17+\tfrac1{11}+\dots\) also diverges.

The golden key means that anything we learn about the zeta function is secretly information about the primes. And the zeta function, unlike the primes, is smooth. You can use the tools of calculus on it. That is the bet Riemann made.

Chapter 8

Numbers that turn

Riemann's great idea was to feed zeta numbers that are not on the ordinary number line. To follow him we need complex numbers. They have a scary name and a friendly meaning: they are arrows on a flat page.

The square root of −1

No ordinary number squares to −1, because positive times positive and negative times negative are both positive. So mathematicians invented one and called it \(i\), with the single rule \(i \times i = -1\).For centuries these were called "imaginary", a name Descartes gave partly as a put-down. They are no more imaginary than negative numbers, which were also distrusted for a long time. Both are useful extensions of counting.

A complex number is something like \(3 + 2i\): a real part (3) and an imaginary part (2). Picture it as a point on a map, 3 steps east and 2 steps north. The ordinary numbers are the east–west line; the multiples of \(i\) are the north–south line. The whole page is the complex plane.

Multiplying by i is turning

Take 1 and multiply by \(i\) repeatedly: \(1 \to i \to -1 \to -i \to 1\). On the map that is east, north, west, south, east. Multiplying by \(i\) turns any arrow a quarter-turn anticlockwise. In general, multiplying two complex numbers multiplies their lengths and adds their angles. That one fact is the key to everything that follows.

The complex plane. 3 + 2i is an arrow; multiplying by i turns arrows a quarter turn.

Euler's spinning formula

An arrow of length 1 pointing at angle \(\theta\) (measured in radiansA radian is the angle that cuts off an arc as long as the radius. A full turn is \(2\pi \approx 6.283\) radians, so a quarter turn is \(\pi/2\).) is written

\(e^{i\theta} = \cos\theta + i\sin\theta.\)

This is Euler's formula. The cosine is how far east the arrow tip is, the sine is how far north. Setting \(\theta = \pi\), a half turn, gives the celebrated \(e^{i\pi} = -1\).Often written \(e^{i\pi}+1=0\) and voted "the most beautiful equation" in more than one poll. It links \(e\), \(i\), \(\pi\), 1 and 0 in one line. As \(\theta\) grows steadily, \(e^{i\theta}\) spins round the circle steadily. It is a clock hand.

Turn the hand: its east and north shadows trace out the cosine and sine waves.

Powers with a complex exponent

What could \(n^{s}\) mean if \(s = \sigma + it\) is complex?By tradition the real part of \(s\) is called \(\sigma\) (sigma) and the imaginary part \(t\). These letters go back to Riemann's own paper. Using the rule that exponents add,

\(n^{-s} = n^{-\sigma}\cdot n^{-it} = \dfrac{1}{n^\sigma}\cdot e^{-it\ln n}.\)

In words: \(\tfrac1{n^s}\) is an arrow of length \(\tfrac1{n^\sigma}\), turned by an angle \(-t\ln n\). The real part \(\sigma\) sets how fast the arrows shrink. The imaginary part \(t\) sets how fast they spin. Bigger \(n\) spins faster, but only logarithmically faster.

So \(\zeta(s)\) with complex \(s\) is a chain of arrows laid head to tail, each shorter than the last and each turned a little more. Where the chain ends up is the value of \(\zeta(s)\). Play with it:

When \(\sigma\) is bigger than 1, the arrows shrink fast enough that the chain settles to a point. When \(\sigma\) is 1 or less, the chain spirals outward forever, so we use a standard correction that subtracts the drift, and the chain then winds into a definite point.The figure plots \(\sum_{n\le N} n^{-s} - \frac{N^{1-s}}{1-s}\), which tends to \(\zeta(s)\) whenever \(\sigma > 0\) and \(s \ne 1\). The ghost spiral that keeps drifting is the uncorrected sum. Set \(\sigma = 0.5\) and \(t = 14.1347\). The chain winds right into the centre. You have just found the first zero of the zeta function.

The zeta spiral, swept upward in t. Each time the spiral winds into the centre, the music stops: a zero.from the film
Chapter 9

Beyond the edge of the map

The sum \(1 + 2^{-s} + 3^{-s} + \dots\) only makes sense when the real part of \(s\) is bigger than 1. To the left of that line the arrows do not shrink fast enough and the sum falls apart. In 1859 Bernhard Riemann showed that the function itself does not have to stop there.

One road, many paths

Here is a simpler example of the same magic. The sum \(1 + x + x^2 + x^3 + \dots\) only works when \(x\) is between −1 and 1. Inside that range it equals \(\tfrac{1}{1-x}\). But the formula \(\tfrac1{1-x}\) makes perfect sense for \(x = 3\), giving \(-\tfrac12\), even though the sum \(1+3+9+27+\dots\) is nonsense.

The formula is the "true" function. The sum was just one way of describing it that happened to work in one region. Extending a function beyond the region where its first description works is called analytic continuation.The deep fact is that for well-behaved complex functions (called analytic or holomorphic), the continuation is unique. Knowing the function on any small patch determines it everywhere it can reach. Complex functions are far more rigid than real ones, like a crystal where one corner fixes the whole shape. For zeta, the continuation reaches every complex number except \(s = 1\), where the function shoots off to infinity like the harmonic series.

Riemann's mirror

Riemann found that zeta has a hidden symmetry. Its value at \(s\) and its value at \(1 - s\) are tied together by an exact formula, the functional equation:

\(\zeta(s) = 2^s\,\pi^{s-1}\,\sin\!\Big(\dfrac{\pi s}{2}\Big)\,\Gamma(1-s)\,\zeta(1-s).\)

Do not worry about the individual pieces.\(\Gamma\) (capital gamma) is the Gamma function, which extends the factorial to non-whole numbers: \(\Gamma(n) = (n-1)!\). I spent several days in August plotting it, which is how it ended up in the research folder. The shape is what matters: the formula is a mirror. The point \(s\) and the point \(1-s\) are reflections of each other through the point \(\tfrac12\). The line where the real part is exactly \(\tfrac12\) is the mirror itself. That line will matter enormously.

The functional equation pairs every s with its reflection 1 − s through the point ½.
The famous −1/12. Continuation gives \(\zeta(-1) = -\tfrac1{12}\). You may have seen the claim "\(1+2+3+4+\dots = -\tfrac1{12}\)". That is not true as ordinary addition, the sum is infinite. What is true is that the continued zeta function, which would be that sum if the sum made sense, takes the value \(-\tfrac1{12}\) at \(s=-1\). Physicists use this in string theory and the Casimir effect, carefully.
Chapter 10

Where zeta vanishes

A zero of a function is an input where its output is exactly 0. For zeta there are two very different kinds.

The trivial zeros

The \(\sin(\pi s/2)\) in the mirror formula is zero at every even whole number. That forces \(\zeta(-2) = \zeta(-4) = \zeta(-6) = \dots = 0\). These are called the trivial zeros, not because they are unimportant but because we know exactly where they are and why.

The nontrivial zeros

All the other zeros live in a narrow vertical band where the real part is between 0 and 1, called the critical strip.Zeta has no zeros with real part above 1, because there the Euler product is a product of nonzero factors that converges, and such a product cannot be zero. The mirror then rules out zeros with real part below 0, apart from the trivial ones. They come in mirror pairs and in up–down pairs, so if \(\tfrac12 + 14.13i\) is a zero, so is \(\tfrac12 - 14.13i\). The first few, going up from the real line, are near

\(t = 14.1347,\;\; 21.0220,\;\; 25.0109,\;\; 30.4249,\;\; 32.9351,\;\; 37.5862,\;\dots\)

and every single one ever computed has real part exactly \(\tfrac12\). They sit right on the mirror line, which is called the critical line.

Where the zeros of ζ live, up to height 50.
The size \(|\zeta(\sigma+it)|\) as \(t\) runs from 0 to 50. Only at σ = ½ does the curve touch zero.
The Riemann Hypothesis

Every nontrivial zero of the zeta function has real part exactly \(\tfrac12\).

Riemann wrote, in the middle of his paper, that this was "very likely", and that he had set aside the search for a proof after some fleeting vain attempts.The original German is "sehr wahrscheinlich". His paper is only eight pages long and is the only one he ever wrote on number theory. It contains several claims he did not prove, most of which were proved later. This one never was. That was 1859. It is still open.

Colouring ζ: every point is coloured by the angle of ζ(s). Where all the colours meet, ζ is zero, and they always meet on the line.from the film

How much evidence is there? Over ten trillion zeros have been computed, and every one lies on the line.Xavier Gourdon and Patrick Demichel checked the first \(10^{13}\) zeros in 2004. David Platt and Tim Trudgian gave a rigorous verification to height \(3\times10^{12}\) in 2021. Andrew Odlyzko computed zeros near the \(10^{23}\)rd, also all on the line. We also know that at least 40% of all the zeros are on the line. But in number theory, ten trillion examples can still fail to be a proof. Some patterns hold for longer than any computer can check and then break.Famous example: \(\pi(x) < \mathrm{Li}(x)\) for every \(x\) anyone has ever checked, yet Littlewood proved in 1914 that it fails infinitely often. The first failure is somewhere below about \(10^{316}\), far beyond computation.

Slide the line: only at σ = ½ does the curve of ζ pass through zero. Later, the spacing of the zeros against the random-matrix law.from the film
Chapter 11

The music of the primes

Why should anyone care where the zeros of some function live? Because of the most beautiful formula in this book, Riemann's explicit formula. It says the primes are a chord, and the zeros are its notes.

A tidier staircase

The count \(\pi(x)\) jumps up by 1 at every prime. It is a staircase with uneven steps. Mathematicians prefer a slightly different staircase, written \(\psi(x)\) ("psi of x"), which jumps by \(\ln p\) at each prime \(p\), and also at each prime power \(p^2, p^3, \dots\)Called the Chebyshev function. Weighting each prime by \(\ln p\) cancels out its thinning, so \(\psi(x)\) grows almost exactly like the straight line \(x\). The prime number theorem is equivalent to \(\psi(x)/x \to 1\). The reason is simple: if the chance of being prime near \(x\) is \(1/\ln x\), giving each prime a weight of \(\ln x\) makes the staircase climb like a straight line, \(\psi(x) \approx x\).

Riemann's formula

\(\psi(x) = x \;-\; \displaystyle\sum_{\rho} \frac{x^{\rho}}{\rho} \;-\; \ln 2\pi \;-\; \tfrac12\ln\!\big(1-x^{-2}\big).\)

In words: the prime staircase equals the straight line \(x\), minus one correction for every nontrivial zero \(\rho\) ("rho") of zeta, minus two small tidy-up terms.This form was proved by Hans von Mangoldt in 1895, following Riemann's sketch. The sum over zeros has to be taken in pairs, \(\rho\) with its partner \(\bar\rho\), in order of height, or it does not converge.

Now look at one correction term. Write the zero as \(\rho = \tfrac12 + i\gamma\). Then

\(x^{\rho} = x^{1/2}\cdot x^{i\gamma} = \sqrt{x}\; e^{\,i\gamma\ln x}.\)

That is a spinning arrow, from Chapter 8! Its length is \(\sqrt x\), and it spins as \(\ln x\) grows, at a speed set by the height \(\gamma\) of the zero. Paired with its mirror partner, the spin becomes a wave: a cosine of \(\gamma \ln x\), with loudness \(\sqrt x\). Every zero contributes one pure tone. The real part of the zero sets how loud that tone gets. The height of the zero sets its pitch.

The bright staircase is \(\psi(x)\) from the true primes. The blue curve is Riemann's formula with only the first few zeros. Add more and watch the steps appear.

This is what my prime wave was groping toward from the first day. I tried to build the primes out of waves from the small primes, and those waves repeat every 210 steps, so they can never capture something that does not repeat. Riemann's waves come from the zeros, not from the primes, and their frequencies are not related by simple ratios. They never quite repeat. Add enough of them and the staircase of the primes rises out of pure oscillation.In the film, the explicit formula scene literally plays each zero as a tone as it gets added, so you can hear the staircase being built. Marcus du Sautoy's book The Music of the Primes takes its title from this idea.

Riemann's explicit formula, adding the zeros one at a time, up to 1,000 of them.from the film
Chapter 12

Why the line matters

Now the hypothesis has a meaning you can feel. Each zero adds a wave of loudness \(x^{\sigma}\), where \(\sigma\) is its real part. If every \(\sigma\) is \(\tfrac12\), every wave grows like \(\sqrt x\) and no faster.

So if the Riemann hypothesis is true, the error in counting primes is about the size of \(\sqrt x\):

\(\big|\pi(x) - \mathrm{Li}(x)\big| \;\le\; \dfrac{\sqrt{x}\,\ln x}{8\pi}\quad\text{for all } x \ge 2657.\)

This exact bound was proved by Lowell Schoenfeld in 1976, assuming the hypothesis.And the converse holds too: if the error stays that small, the hypothesis is true. The two statements are logically the same. And \(\sqrt x\) is special. Flip a fair coin \(x\) times and count heads; your typical distance from \(x/2\) is also about \(\sqrt x\). The hypothesis says the primes are as orderly as a fair random process can be. No more chaotic than coin tosses, and, since the primes are not literally random, it is the best regularity one could hope for.

If even one zero were off the line, at real part \(0.6\) say, its wave would grow like \(x^{0.6}\), drowning out all the others, and the primes would have a lopsided bias that we have never seen.

Why one zero off the line would matter: its wave would outgrow all the others.

Other doors into the same room

The hypothesis can be restated in surprising ways that do not mention complex numbers at all. Each one is exactly equivalent.

The Clay Mathematics Institute offers one million dollars for a proof. Hundreds of published theorems begin "Assuming the Riemann hypothesis…", and they would all become unconditional the day it is proved.It is one of the seven Millennium Prize Problems announced in 2000, and it was already on David Hilbert's famous list of 23 problems in 1900. Hilbert supposedly said that if he woke after sleeping for five hundred years, his first question would be whether it had been proved.

Robin's inequality checked for every n up to a million. Past 5040 nothing crosses the line.from the film
Chapter 13

An echo from physics

In 1972, at afternoon tea in Princeton, the number theorist Hugh Montgomery mentioned to the physicist Freeman Dyson what he had found about the spacing between consecutive zeta zeros. Dyson recognised the formula at once. It was the spacing law for energy levels of heavy atomic nuclei.

The zeros do not scatter like raindrops, which would sometimes land close together. They repel each other, keeping a characteristic distance, exactly like the eigenvalues of large random matrices of a particular type, called the Gaussian Unitary Ensemble.An eigenvalue of a matrix is a number \(\lambda\) for which the matrix acts on some arrow by just stretching it by \(\lambda\). In quantum mechanics, the eigenvalues of the energy operator are the allowed energy levels. "Unitary" refers to the symmetry type of the matrices. Andrew Odlyzko later checked this across millions of zeros at enormous heights, and the match is breathtaking.

Zeta zeros against random points.

This suggests a dream, the Hilbert–Pólya idea: maybe there is some physical system whose energy levels are exactly the heights of the zeta zeros. The energies of a quantum system are always real numbers, for a certain kind of operator. That would force every zero onto the critical line, and the hypothesis would follow. Nobody has found the system. My own "prime matrix" on 17 August was a crooked first step in this direction. Its eigenvalues split by parity, odd and even, not by zeta. But it taught me what such an object would need to look like.

Chapter 14

What I tried, and what broke

I spent June to September 2025 trying to break the primes open with code. I want to be honest about how that went, because the failures taught me the most, and because almost everyone who falls in love with primes makes the same mistakes I did.

The prime wave

Each prime sends a wave, and where no wave arrives, the number is prime. My checker printed 78,498 correct out of 78,498 below a million and I was thrilled. Then I noticed I had used waves from all primes up to \(\sqrt{1{,}000{,}000} = 1000\). Of course it was perfect: that is the sieve of Eratosthenes, which is exact up to \(P^2\). With fewer waves, composites like 121 slip through. Lesson: a perfect score is a warning sign. Check what information you fed in.

Primes on a circle

I sent each number into the complex plane as a sum of spinning arrows, one for each prime factor. Every prime landed on the unit circle. Then I tested every number, not just the convenient ones, and 4, 8, 9, 16 and 25 were on the circle too. A number with only one distinct prime factor gets only one arrow, and one arrow of length 1 always ends on the circle. I had built a prime-power detector. Lesson: test the negatives, not just the positives.

Asking machines

I encoded the primes as a string of bits, two for each \(k\) (is \(6k-1\) prime, is \(6k+1\) prime), and asked large language models for the rule. They gave me recurrences that matched my first hundred pairs perfectly, then scored 24% and 25% on the next nine hundred. Always guessing "not prime" scored 47%. A rule that fits \(n\) bits always exists, about \(n/2\) long,This is the Berlekamp–Massey algorithm: given any sequence of \(n\) bits, it finds the shortest linear recurrence that reproduces it, and for a random-looking sequence that recurrence has length about \(n/2\). Fitting is free. Predicting is everything. so fitting proved nothing. Lesson: fitting the data you trained on is not understanding. Always hold some back.

Spirals and sound

The spirals and walks I drew were real and beautiful, and they showed real structure: multiples of 6 dominate the gaps, Euler's polynomial draws the Sacks curves, and Dirichlet's theoremDirichlet proved in 1837 that every progression \(a, a+d, a+2d, \dots\) with \(a\) and \(d\) sharing no factor contains infinitely many primes, and in the long run, equally many in each such progression. So primes ending in 1, 3, 7 and 9 each make up a quarter. draws the webs. But every pattern I found was one that number theorists had explained long ago. Lesson: beauty is a reason to look closer, not a proof.

The prime walk: walk straight, and turn at every prime by the size of the gap. Twenty thousand primes as one thread.from the film

Where it led

Every road I took bent toward the same place. Waves led to zeta. Phases led to the complex plane. The complex plane led to the critical line. The wave picture was right all along, it was just pointed the wrong way. The primes really are made of waves. The waves come from the zeros, not from the primes themselves.

Chapter 15

If you want to go on

If this book made you curious, here is a path, from gentle to serious.

And please write to me at joycemalik14@gmail.com if you find a mistake, or anything strange in the numbers.

At the back

Glossary

Analytic continuation
Extending a function beyond the region where its first formula works, in the only consistent way. Chapter 9.
Complex number
A number \(a + bi\) with \(i^2 = -1\), pictured as a point or arrow on a plane. Chapter 8.
Composite
A whole number bigger than 1 that is not prime, like 4, 6, 9. Chapter 1.
Converge / diverge
An infinite sum converges if its running total settles toward a fixed value, and diverges if it does not. Chapter 6.
Critical line
The vertical line of complex numbers with real part exactly ½. Chapter 10.
Critical strip
The band of complex numbers with real part between 0 and 1, where all nontrivial zeros live. Chapter 10.
Divisor
A whole number that goes into another exactly. Chapter 1.
Euler product
Zeta written as a product over primes. The link between zeta and primes. Chapter 7.
Explicit formula
Riemann's formula writing the prime staircase as a line plus one wave per zero. Chapter 11.
Logarithm
How many times you multiply a base to reach a number. \(\ln\) uses the base \(e \approx 2.718\). Chapter 4.
π(x)
The number of primes up to \(x\). Chapter 4.
Prime
A whole number bigger than 1 whose only divisors are 1 and itself. Chapter 1.
Prime Number Theorem
\(\pi(x)\) is about \(x/\ln x\), with the ratio tending to 1. Chapter 4.
Riemann hypothesis
All nontrivial zeros of zeta have real part ½. Chapter 10.
Sieve of Eratosthenes
Finding primes by crossing out multiples. Chapter 3.
Zero
An input where a function outputs 0. Chapter 10.
Zeta function, ζ(s)
\(1 + 2^{-s} + 3^{-s} + \dots\), and its continuation to all complex \(s \ne 1\). Chapters 6 and 9.

∎