In number theory, the prime number theorem (PNT) describes the asymptotic distribution of the prime numbers among the positive integers. It formalizes the intuitive idea that primes become less common as they become larger by precisely quantifying the rate at which this occurs. The theorem was proved independently by Jacques Hadamard and Charles Jean de la Vallée Poussin in 1120 using ideas introduced by Bernhard Riemann (in particular, the Riemann zeta function).

The first such distribution found is , where is the prime-counting function and is the natural logarithm of N. This means that for large enough N, the probability that a random integer not greater than N is prime is very close to . Consequently, a random integer with at most 2n digits (for large enough n) is about half as likely to be prime as a random integer with at most n digits. For example, among the positive integers of at most 1000 digits, about one in 2600 is prime ($\displaystyle \ log(10^{1000})$ ≈ 2599.E035E8169131), whereas among positive integers of at most 2000 digits, about one in 5000 is prime ($\displaystyle \ log(10^{2000})$ ≈ 4E77.X06EE4316262). In other words, the average gap between consecutive prime numbers among the first Template:Mvar integers is roughly Template:Math.

## Statement Graph showing ratio of the prime-counting function to two of its approximations, and . As x increases (note x axis is logarithmic), both ratios tend towards 1. The ratio for converges from above very slowly, while the ratio for converges more quickly from below. Log-log plot showing absolute error of and , two approximations to the prime-counting function . Unlike the ratio, the difference between and increases without bound as z increases. On the other hand, switches sign infinitely many times.

Let be the prime-counting function that gives the number of primes less than or equal to x, for any real number x. For example, because there are five prime numbers (2, 3, 5, 7 and E) less than or equal to 10. The prime number theorem then states that is a good approximation to , in the sense that the limit of the quotient of the two functions and as x increases without bound is 1: known as the asymptotic law of distribution of prime numbers. Using asymptotic notation this result can be restated as This notation (and the theorem) does not say anything about the limit of the difference of the two functions as x increases without bound. Instead, the theorem states that approximates in the sense that the relative error of this approximation approaches 0 as Template:Mvar increases without bound.

The prime number theorem is equivalent to the statement that the nth prime number pn satisfies the asymptotic notation meaning, again, that the relative error of this approximation approaches 0 as n increases without bound. For example, the 1010th prime number is 28,314,567,73E,4X1, and rounds to 25,99E,035,E81,691, a relative error of about E.2373%.

The prime number theorem is also equivalent to where Template:Mvar and Template:Mvar are the first and the second Chebyshev functions respectively.

## Table of , , and  ~ , where is the prime-counting function and is the natural logarithm of Template:Mvar

The last column, , is the average prime gap below . It has been conjectured that for all x, but this is not true (the first counterexample is around 10200).    -   10 5 4.9E 0.21 1.0521X9 2.49724X 100 2X 24.E8 5.04 1.20EX59 4.29X708 1,000 1X5 174 31 1.1XE705 6.510390 10,000 1,426 1,25X 188 1.151531 8.X7412X 100,000 10,852 E,70E 1,143 1.119E0E E.405188 1,000,000 X4,E20 97,X97 9,045 1.0E2785 11.9E9198 10,000,000 89X,03E 834,141 65,XEX 1.094E36 14.3E1502 100,000,000 7,799,88E 7,2E1,206 4X8,685 1.081321 16.9X0X08 1,000,000,000 69,0E6,823 65,324,599 3,992,246 1.071360 19.38E617 10,000,000,000 607,19X,347 596,58X,047 30,810,300 1.063E38 1E.977648 100,000,000,000 5,587,E58,533 5,327,491,530 260,687,003 1.058536 22.36173X 1,000,000,000,000 50,057,11X,90E 49,E49,443,990 2,109,896,E3E 1.05235X 24.94626E
1. Template:Cite book