Euler proved that the primes never end (see his chapter). But how many are there? At 15 years old, Gauss He spent his free time counting cousins in tables, one thousand at a time. Did you notice that, close to a number $x$, more or less 1 in every $\ln x$ number is prime. Hence the estimate: the number of primes up to $x$, which we call $\pi(x)$, is similar to

$$\pi(x) \approx \frac{x}{\ln x}, \qquad \text{ou melhor ainda,} \qquad \pi(x) \approx \text{Li}(x) = \int_2^x \frac{dt}{\ln t}.$$
$x$ Cousins ​​up to $x$ $x / \ln x$ $\text{Li}(x)$
100 25 21,7 29,1
1 000 168 144,8 176,6
10 000 1 229 1 085,7 1 245,1
100 000 9 592 8 685,9 9 628,8
1 000 000 78 498 72 382,4 78 626,1
The computer counts the real primes (in blue) and compares them with Gauss’s estimates. The larger x, the smaller the error in percentage.

Gauss never proved this estimate. It was only demonstrated in 1896, by Jacques Hadamard and Charles de la Vallée Poussin, and today it is called prime number theorem.


All topics by Carl Friedrich Gauss · ← The fundamental theorem of algebra · Ceres and the least squares method →

Credits and sources of images.