Reading Time: 2 minutes

Ulam_spiral_primesThe Prime Number Theorem (PNT) describes the distribution of prime numbers. Euclid could prove that there is an infinite number of primes, but their location can only be predicted by statistical means, as an approximation.  As ordinary numbers get larger and larger,  we find fewer and fewer prime numbers scattered among them. This can easily be demonstrated with the “Sieve of Eratosthenes.”  It has resulted in a hunt to find a formula for the location of primes, which is also essential for encrypting messages send across public information highways. Evewn though we cannot predict primes (yet?), we find that the distribution of prime numbers is asymptotic, and follows very precise laws.  In simple terms, the Prime Number Theorem says that, as x approaches infinity, the quotient between x and ln(x)  becomes a better and better estimate of the number of primes at or below x.  That’s not a lot, but it’s as far as we got, and there is still a lot more we can find out about primes.

Here is some more math:

For any positive real number x, we define

\pi(x)={\rm the\ number\ of\ primes\ that\ are\ }\leq x

The prime number theorem then states that


where ln(x) is the natural logarithm of x. This notation means that the limit of the quotient of the two functions π(x) and x/ln(x) as x approaches infinity is 1; it does not mean that the limit of the difference of the two functions as x approaches infinity is zero.

An even better approximation, and an estimate of the error term, is given by the formula

\pi(x)={\rm Li} (x) + O \left(x e^{-\frac{1}{15}\sqrt{\ln(x)}}\right)

for x → ∞ (see big O notation). Here Li(x) is the offset logarithmic integral function.

Here is a table that shows how the three functions (π(x), x/ln(x) and Li(x)) compare:

xπ(x)π(x) – x/ln(x)Li(x) – π(x)x/π(x)
10140 22.500
102253 54.000
10316823 105.952
1041,229143 178.137
1059,592906 3810.430
10678,4986,116 13012.740
107664,57944,159 33915.050
1085,761,455332,774 75417.360
10950,847,5342,592,592 1,70119.670
1010455,052,51120,758,029 3,10421.980
10114,118,054,813169,923,159 11,58824.280
101237,607,912,0181,416,705,193 38,26326.590
1013346,065,536,83911,992,858,452 108,97128.900
10143,204,941,750,802102,838,308,636 314,89031.200
101529,844,570,422,669891,604,962,452 1,052,61933.510
1016279,238,341,033,9257,804,289,844,392 3,214,63235.810
4 ·10161,075,292,778,753,15028,929,900,579,949 5,538,86137.200

As a consequence of the prime number theorem, one get an asymptotic expression for the nth prime number p(n):

p(n)\sim n\ln(n).

One can also derive the probability that a random number n is prime: 1/ln(n).

The theorem was conjectured by Adrien-Marie Legendre in 1798 and proved independently by Hadamard and de la Vallée Poussin in 1896. The proof used methods from complex analysis, specifically the Riemann zeta function. Nowadays, so-called “elementary” proofs are available that only use number theoretic means. The first of these was provided partly independently by Paul Erdös and Atle Selberg in 1949 although it was previously believed that such proofs with only real variables could not be found.

Related Articles: