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 ${\displaystyle \pi(N)~\frac{N}{\log(N)}}$, where ${\displaystyle \pi(N)}$ is the prime-counting function and ${\displaystyle \log(N)}$ 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 ${\displaystyle \frac{1}{\log(N)}}$. 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.[1]

## Statement

Let ${\displaystyle \pi(x)}$ be the prime-counting function that gives the number of primes less than or equal to x, for any real number x. For example, ${\displaystyle \pi(10)=5}$ 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 ${\displaystyle \frac{x}{\log(x)}}$ is a good approximation to ${\displaystyle \pi(x)}$, in the sense that the limit of the quotient of the two functions ${\displaystyle \pi(x)}$ and ${\displaystyle \frac{x}{\log(x)}}$ as x increases without bound is 1:

${\displaystyle \lim_{x\to\infty}\frac{\;\pi(x)\;}{\;\left[ \frac{x}{\log(x)}\right]\;} = 1,}$

known as the asymptotic law of distribution of prime numbers. Using asymptotic notation this result can be restated as

${\displaystyle \pi(x)\sim \frac{x}{\log x}.}$

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 ${\displaystyle \frac{x}{\log(x)}}$ approximates ${\displaystyle \pi(x)}$ 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

${\displaystyle p_n \sim n\log(n),}$

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 ${\displaystyle 10^{10}log(10^{10})}$ rounds to 25,99E,035,E81,691, a relative error of about E.2373%.

The prime number theorem is also equivalent to

${\displaystyle \lim_{x\to\infty} \frac{\vartheta (x)}x = \lim_{x\to\infty} \frac{\psi(x)}x=1,}$

where Template:Mvar and Template:Mvar are the first and the second Chebyshev functions respectively.

## Table of ${\displaystyle \pi(x)}$, ${\displaystyle x/\log(x)}$, and ${\displaystyle li(x)}$

${\displaystyle \pi(N)}$~

${\displaystyle \frac{N}{log(N)}}$ , where

${\displaystyle \pi(N)}$ is the prime-counting function and

${\displaystyle log(N)}$ is the natural logarithm of Template:Mvar

The last column,

${\displaystyle \frac{N}{\pi(N)}}$ , is the average prime gap below

${\displaystyle N}$ .

${\displaystyle li(x)=\int_0^x\frac{1}{\ln t}dt}$

It has been conjectured that ${\displaystyle \pi(x) for all x, but this is not true (the first counterexample is around 10200).

 ${\displaystyle N}$ ${\displaystyle \pi(N)}$ ${\displaystyle \frac{N}{log(N)}}$ ${\displaystyle \pi(N)}$- ${\displaystyle \frac{N}{log(N)}}$ ${\displaystyle \frac{\pi(N)}{N/log(N)}}$ ${\displaystyle \frac{N}{\pi(N)}}$ 10 5 4.9E 0.21 1.0521X9 2.49724X 100 2X 24.E8 5.04 1.20EX59 4.29X708 1000 1X5 174 31 1.1XE705 6.510390 10,000 1426 125X 188 1.151531 8.X7412X 100,000 10,852 E70E 1143 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