Counting the prime numbers
The prime numbers seem to appear at random: 2, 3, 5, 7, 11, 13, then a gap until 17, 19, 23, another until 29. But seen from afar, they obey a rule. Call $\pi(x)$ the number of primes less than or equal to $x$. While still a teenager, Gauss noticed, looking at tables, that near a number $x$ the density of primes is about $\frac{1}{\ln x}$, and proposed the estimate
$$\pi(x) \approx \operatorname{li}(x) = \int_0^x \frac{dt}{\ln t},$$the logarithmic integral. Nobody knew how to prove that it was good, nor how to explain the deviations.
An eight-page paper
In November 1859, on being elected to the Berlin Academy, Riemann sent his only paper on number theory: On the Number of Primes Less Than a Given Magnitude. It is eight pages long. In it, Riemann used the zeta function and Euler’s product to write an exact formula for the count of primes.
The cleanest form of the idea uses a slightly modified count, which Riemann called $f(x)$: it counts each prime with weight 1, each square of a prime with weight $\frac{1}{2}$, each cube with weight $\frac{1}{3}$, and so on. Riemann’s formula says that
$$f(x) = \operatorname{li}(x) - \sum_{\rho}\operatorname{li}(x^{\rho}) - \ln 2 + \int_x^{\infty}\frac{dt}{t(t^2 - 1)\ln t},$$where the sum runs over the non-trivial zeros $\rho$ of the zeta function. The first term is Gauss’s estimate; the last two are small. What separates the smooth curve $\operatorname{li}(x)$ from the irregular staircase of the primes is the sum over the zeros.
The waves of the zeros
Each zero $\rho = \frac{1}{2} + i\gamma$ (assuming the Riemann hypothesis) contributes an oscillation of size about $\frac{\sqrt{x}}{\ln x}$, which undulates with frequency $\gamma$. The zeros work like the notes of an instrument: adding more and more of them, the smooth curve bends until it reproduces, step by step, the staircase of the primes. That is why the zeros of zeta are said to hold the “music of the primes”.
Undoing the weighted count, Riemann obtained an approximation for the true count, the function
$$R(x) = \sum_{n=1}^{\infty}\frac{\mu(n)}{n}\operatorname{li}\!\left(x^{1/n}\right) = \operatorname{li}(x) - \frac{1}{2}\operatorname{li}\!\left(\sqrt{x}\right) - \frac{1}{3}\operatorname{li}\!\left(\sqrt[3]{x}\right) - \cdots,$$where $\mu$ is the Möbius function. It is much better than $\operatorname{li}(x)$:
| $x$ | $\pi(x)$ | $\frac{x}{\ln x}$ | $\operatorname{li}(x)$ | $R(x)$ |
|---|---|---|---|---|
| 100 | 25 | 21.7 | 30.1 | 25.7 |
| 1 000 | 168 | 144.8 | 177.6 | 168.4 |
| 10 000 | 1 229 | 1 085.7 | 1 246.1 | 1 226.9 |
| 1 000 000 | 78 498 | 72 382 | 78 628 | 78 527 |
The prime number theorem
Riemann’s paper did not prove all the claims it made; some steps were left as sketches. But it showed the way. In 1896, Jacques Hadamard and Charles de la Vallée Poussin, independently, followed Riemann’s ideas and proved the prime number theorem: $\pi(x)$ and $\frac{x}{\ln x}$ grow in the same proportion, that is, the ratio between them tends to 1. The key piece was to show that zeta has no zeros on the line $\sigma = 1$.
Exercise: π(30)
Count the primes up to 30 and compare with $\frac{30}{\ln 30}$.
The primes up to 30 are 2, 3, 5, 7, 11, 13, 17, 19, 23, 29: ten. And $\frac{30}{\ln 30} = \frac{30}{3.401} \approx 8.8$. The simple estimate errs on the low side, as in the table; $\operatorname{li}(30) \approx 13.0$ errs on the high side.
Exercise: the weighted count
Compute Riemann’s count $f(10)$, in which each prime counts 1, each square of a prime $\frac{1}{2}$ and each cube $\frac{1}{3}$.
Primes up to 10: 2, 3, 5, 7, which give 4. Squares of primes up to 10: 4 and 9, which give $2 \cdot \frac{1}{2} = 1$. Cubes: 8, which gives $\frac{1}{3}$. There are no fourth powers: $2^4 = 16$ already exceeds 10. So $f(10) = 4 + 1 + \frac{1}{3} = 5.33$. The relation with the ordinary count is $f(x) = \pi(x) + \frac{1}{2}\pi(\sqrt{x}) + \frac{1}{3}\pi(\sqrt[3]{x}) + \cdots = 4 + \frac{1}{2}\cdot 2 + \frac{1}{3}\cdot 1$.
Sources: Bernhard Riemann, “Ueber die Anzahl der Primzahlen unter einer gegebenen Grösse”, Monatsberichte der Berliner Akademie (November 1859) · Harold M. Edwards, Riemann’s Zeta Function (1974) · Jacques Hadamard, “Sur la distribution des zéros de la fonction ζ(s) et ses conséquences arithmétiques”, Bulletin de la Société Mathématique de France 24 (1896) · Marcus du Sautoy, The Music of the Primes (2003).
All topics on Bernhard Riemann · ← The zeta function · The Riemann hypothesis →