Prime number theorem
In mathematics, the prime number theorem (PNT) describes the asymptotic distribution of prime numbers among the positive integers.
≈ 20 min read
Names in other languages
No names in other languages are held for this entry yet.
Article bodies are English and are not machine-translated. A name in another language is not a translation of the article.
In mathematics, the prime number theorem (PNT) describes the asymptotic distribution of 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 1896 using ideas introduced by Bernhard Riemann (in particular, the Riemann zeta function). The first such distribution found is , where is the prime-counting function (the number of primes less than or equal to N) and is the natural logarithm of .
This means that for large enough , the probability that a random integer not greater than is prime is very close to . In other words, the average gap between consecutive prime numbers among the first integers is roughly . Consequently, a random integer with at most digits (for large enough ) is about half as likely to be prime as a random integer with at most digits.
For example, among the positive integers of at most 1000 digits, about one in 2300 is prime ( ), whereas among positive integers of at most 2000 digits, about one in 4600 is prime ( ). \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 \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 increases without bound. Instead, the theorem states that approximates in the sense that the relative error of this approximation approaches 0 as increases without bound.
The prime number theorem is equivalent to the statement that the th prime number satisfies p_n \sim n\log(n), the asymptotic notation meaning, again, that the relative error of this approximation approaches 0 as increases without bound. For example, the th prime number is , and ( )log( ) rounds to , a relative error of about 6.4%.
On the other hand, the following asymptotic relations are logically equivalent: \begin{align} \lim_{x\rightarrow \infty}\frac{\pi(x)\log x}{x}&=1,\text{ and}\\ \lim_{x\rightarrow \infty}\frac{\pi(x)\log \pi(x)}{x}\,&=1. \end{align} As outlined below, the prime number theorem is also equivalent to \lim_{x\to\infty} \frac{\vartheta (x)}x = \lim_{x\to\infty} \frac{\psi(x)}x=1, where and are the first and the second Chebyshev functions respectively, and to \lim_{x \to \infty} \frac{M(x)}{x}=0, where M(x)=\sum_{n \leq x} \mu(n) is the Mertens function. \psi(x) = \sum_{k \geq 1} \sum_\overset{p^k \le x,}{\!\!\!\!p \text{ is prime}\!\!\!\!} \log p \; . This is sometimes written as \psi(x) = \sum_{n\le x} \Lambda(n) \; , where is the von Mangoldt function, namely \Lambda(n) = \begin{cases} \log p & \text{ if } n = p^k \text{ for some prime } p \text{ and integer } k \ge 1, \\ 0 & \text{otherwise.} \end{cases} It is now relatively easy to check that the PNT is equivalent to the claim that \lim_{x\to\infty} \frac{\psi(x)}{x} = 1 \; .
Indeed, this follows from the easy estimates \psi(x) = \sum_\overset{p\le x}{\!\!\!\! p \text{ is prime}\!\!\!\!} \log p \left\lfloor \frac{\log x}{\log p} \right\rfloor \le \sum_\overset{p\le x}{\!\!\!\! p \text{ is prime}\!\!\!\!} \log x = \pi(x)\log x and (using big notation) for any , \psi(x) \ge \sum_{\!\!\!\!\overset{x^{1-\varepsilon}\le p\le x}{p \text{ is prime}}\!\!\!\!} \log p \ge \sum_{\!\!\!\!\overset{x^{1-\varepsilon}\le p\le x}{p \text{ is prime}}\!\!\!\!} (1-\varepsilon)\log x=(1-\varepsilon)\left(\pi(x)+O\left(x^{1-\varepsilon}\right)\right)\log x \; . The next step is to find a useful representation for .
Let be the Riemann zeta function. It can be shown that is related to the von Mangoldt function , and hence to , via the relation -\frac{\zeta'(s)}{\zeta(s)} = \sum_{n = 1}^\infty \Lambda(n) \, n^{-s} \; .
A delicate analysis of this equation and related properties of the zeta function, using the Mellin transform and Perron's formula, shows that for non-integer the equation \psi(x) = x \; - \; \log(2\pi) \; - \!\!\!\! \sum\limits_{\rho :\, \zeta(\rho) = 0} \frac{x^\rho}{\rho} holds, where the sum is over all zeros (trivial and nontrivial) of the zeta function. This striking formula is one of the so-called explicit formulas of number theory, and is already suggestive of the result we wish to prove, since the term (claimed to be the correct asymptotic order of ) appears on the right-hand side, followed by (presumably) lower-order asymptotic terms.
The next step in the proof involves a study of the zeros of the zeta function. The trivial zeros −2, −4, −6, −8, ... can be handled separately: \sum_{n=1}^\infty \frac{1}{2n\,x^{2n}} = -\frac{1}{2}\log\left(1-\frac{1}{x^2}\right), which vanishes for large .
The nontrivial zeros, namely those on the critical strip , can potentially be of an asymptotic order comparable to the main term if , so we need to show that all zeros have real part strictly less than 1. === Non-vanishing on Re(s) = 1 === To do this, we take for granted that is meromorphic in the half-plane , and is analytic there except for a simple pole at , and that there is a product formula \zeta(s)=\prod_p\frac{1}{1-p^{-s}} for . This product formula follows from the existence of unique prime factorization of integers, and shows that is never zero in this region, so that its logarithm is defined there and \log\zeta(s)=-\sum_p\log \left(1-p^{-s} \right)=\sum_{p,n}\frac{p^{-ns}}{n} \; .
Write ; then \big| \zeta(x+iy) \big| = \exp\left( \sum_{n,p} \frac{\cos ny\log p}{np^{nx}} \right) \; . Now observe the identity 3 + 4 \cos \phi+ \cos 2 \phi = 2 ( 1 + \cos \phi )^2\ge 0 \; , so that \left| \zeta(x)^3 \zeta(x+iy)^4 \zeta(x+2iy) \right| = \exp\left( \sum_{n,p} \frac{3 + 4 \cos(ny\log p) + \cos( 2 n y \log p )}{np^{nx}} \right) \ge 1 for all . Suppose now that .
Certainly is not zero, since has a simple pole at . Suppose that and let tend to 1 from above. Since \zeta(s) has a simple pole at and stays analytic, the left hand side in the previous inequality tends to 0, a contradiction.
Finally, we can conclude that the PNT is heuristically true. To rigorously complete the proof there are still serious technicalities to overcome, due to the fact that the summation over zeta zeros in the explicit formula for does not converge absolutely but only conditionally and in a "principal value" sense.
There are several ways around this problem but many of them require rather delicate complex-analytic estimates. Edwards's book provides the details. Another method is to use Ikehara's Tauberian theorem, though this theorem is itself quite hard to prove.
D.J. Newman observed that the full strength of Ikehara's theorem is not needed for the prime number theorem, and one can get away with a special case that is much easier to prove. The proof uses the same preliminaries as in the previous section except instead of the function \ \psi\ , the Chebyshev function \ \vartheta(x) = \sum_{p\le x} \log p\ is used, which is obtained by dropping some of the terms from the series for \ \psi~.
Similar to the argument in the previous proof based on Tao's lecture, we can show that and for any Thus, the PNT is equivalent to \ \lim _{x \to \infty} \tfrac{\ \vartheta(x)\ }{ x } = 1 ~. Likewise instead of \ - \tfrac{\ \zeta '(s)\ }{ \zeta(s) }\ the function \ \Phi(s) = \sum_{p\le x} \tfrac{\ \log p\ }{\; p^s\ }\ is used, which is obtained by dropping some terms in the series for \ - \tfrac{\ \zeta '(s)\ }{ \zeta(s) } ~.
The functions \ \Phi(s)\ and \ -\tfrac{\ \zeta'(s)\ }{ \zeta(s) }\ differ by a function holomorphic on \ \Re(s) = 1 ~. Since, as was shown in the previous section, \ \zeta(s)\ has no zeroes on the line \ \Re = 1\ , and \ \Phi(s) - \tfrac{ 1 }{\ s - 1\ }\ has no singularities on \ \Re(s) = 1 ~.
One further piece of information needed in Newman's proof, and which is the key to the estimates in his simple method, is that \ \tfrac{\ \vartheta(x)\ }{ x }\ is bounded. This is proved using an ingenious and easy method due to Chebyshev.
Integration by parts shows how \ \vartheta(x)\ and \ \Phi(s)\ are related: For \ \Re(s) > 1\ , \Phi(s) ~=~ \int _1^\infty \frac{ \operatorname{d}\vartheta(x) }{\; x^s\ } ~=~ s \int_1^\infty \frac{ \vartheta(x) }{\ x^{s+1}\ } \operatorname{d}x ~=~ s \int_0^\infty \frac{\; \vartheta(e^t)\ }{\; e^{st}\ } \operatorname{d}t ~. Newman's method proves the PNT by showing the integral I \equiv \int_0 ^\infty \left( \frac{\ \vartheta(e^t)\ }{ e^t } -1 \right) \operatorname{d}t ~. converges, and therefore the integrand goes to zero as \ t \to \infty\ , which is the PNT.
In general, the convergence of the improper integral does not imply that the integrand goes to zero at infinity, since it may oscillate, but since \ \vartheta\ is increasing, it is easy to show in this case. To show the convergence of \ I\ , for \ \Re(z) > 0\ let g_T(z) \equiv \int_0^T f(t)\ e^{-zt} \operatorname{d}t \quad and \quad g(z) \equiv \int_0^\infty f(t)\ e^{-zt} \operatorname{d}t \quad where \quad f(t) \equiv \frac{\ \vartheta(e^t)\ }{ e^t } - 1\ then \lim_{T \to \infty} g_T(z) ~=~ g(z) ~=~ \frac{\ \Phi(s)\ }{ s } - \frac{ 1 }{\ s - 1\ } \qquad \text{where} \quad z \equiv s - 1\ which is equal to a function holomorphic on the line \ \Re(z) = 0 ~.
The convergence of the integral \ I\ , and thus the PNT, is proved by showing that \ \lim_{T \to \infty} g_T(0) ~=~ g(0) ~. This involves change of order of limits since it can be written \ \lim_{T \to \infty}\ \lim_{z \to 0} g_T(z) ~=~ \lim_{z \to 0}\ \lim_{T \to \infty}g_T(z)\ and therefore classified as a Tauberian theorem.
The difference \ g(0) - g_T(0)\ is expressed using Cauchy's integral formula and then shown to be small for large \ T\ by estimating the integrand: Fix \ R > 0\ and \ \delta > 0\ so that \ g(z)\ is holomorphic in the region where \ |z| \le R ~ and ~ \Re(z) \ge - \delta\ , and let \ C\ be the boundary of that region. Since is in the interior of the region, Cauchy's integral formula gives g(0) - g_T(0) ~=~ \frac{ 1 }{\ 2 \pi i\ }\int_C \bigl(\ g(z) - g_T(z)\ \bigr)\ \frac{\ \operatorname{d}z\ }{ z } ~=~ \frac{ 1 }{2 \pi i }\int_C \bigl(\ g(z) - g_T(z)\ \bigr)\ F(z)\ \frac{\ \operatorname{d}z\ }{ z }\ where \ F(z) \equiv e^{zT} \left( 1 + \frac{\; z^2\ }{\; R^2\ } \right)\ is the factor introduced by Newman, which does not change the integral since \ F\ is entire and \ F(0) = 1 ~.
To estimate the integral, break the contour \ C\ into two parts, \ C = C_+ + C_-\ where \ C_+ \equiv C \cap \left\{ z\ \vert\ \Re(z) > 0 \right\}\ and \ C_- \equiv C \cap \left\{ z\ \vert\ \Re(z) \le 0 \right\} ~. Then \ g(0) - g_T(0) ~~=~~ \int_{C_+} \int_T^\infty H(t,z) \operatorname{d}t\ \operatorname{d}z ~~-~ \int_{C_-}\int_0^T H(t,z) \operatorname{d}t \operatorname{d}z ~~+~ \int_{C_-} g(z)\ F(z) \frac{ \operatorname{d}z }{\ 2\pi i z\ }\ , where \ H(t,z) \equiv f(t)\ e^{-tz}\frac{ F(z) }{\ 2 \pi i\ } ~.
Note that \ \frac{\ \vartheta(x)\ }{ x }\ , and hence \ f(t)\ , are bounded; so let \ B\ be some upper bound: \ B \ge \bigl| f(t) \bigr| ~. This bound, combined with the estimate \ \left| F \right|\ \le\ 2\ \exp\!\Bigl( T\ \Re(z) \Bigr) \frac{\ \left| \Re(z) \right|\ }{ R }\ for \ |z| = R\ , together give that the absolute value of the first integral must be \ \le \frac{\ B\ }{ R } ~.
The integrand over \ C_-\ in the second integral is entire, so by Cauchy's integral theorem, the contour \ C_-\ can be modified to a semicircle of radius \ R\ in the left half-plane without changing the integral, and the same argument as for the first integral gives the absolute value of the second integral must be \ \le \frac{\ B\ }{ R } ~. Finally, letting \ T \to \infty\ , the third integral goes to zero since \ e^{zT}\ and hence \ F\ goes to zero on the contour.
Combining the two estimates and the limit get \limsup_{T \to \infty }\ \bigl|\ g(0) - g_T(0)\ \bigr|\ \le\ \frac{\ 2 B\ }{ R }\ ~. This holds for any \ R\ so \ \lim_{T \to \infty} g_T(0) = g(0)\ , and the PNT follows. \operatorname{Li}(x) = \int_2^x \frac{dt}{\log t} = \operatorname{li}(x) - \operatorname{li}(2).
Indeed, this integral is strongly suggestive of the notion that the "density" of primes around should be . This function is related to the logarithm by the asymptotic expansion \operatorname{Li}(x) \sim \frac{x}{\log x} \sum_{k=0}^\infty \frac{k!}{(\log x)^k} = \frac{x}{\log x} + \frac{x}{(\log x)^2} + \frac{2x}{(\log x)^3} + \cdots So, the prime number theorem can also be written as .
In fact, in another paper in 1899 de la Vallée Poussin proved that \pi(x) = \operatorname{Li} (x) + O \left(x e^{-a\sqrt{\log x}}\right) \quad\text{as } x \to \infty for some positive constant , where is the big notation. This has been improved to \pi(x) = \operatorname{li} (x) + O \left(x \exp \left( -\frac{A(\log x)^\frac35}{(\log \log x)^\frac15} \right) \right) where A = 0.2098 .
In 2016, Timothy Trudgian proved an explicit upper bound for the difference between \pi(x) and \operatorname{li}(x) : \big| \pi(x) - \operatorname{li}(x) \big| \le 0.2795 \frac{x}{(\log x)^{3/4}} \exp \left( -\sqrt{ \frac{\log x}{6.455} } \right) for x \ge 229 . The connection between the Riemann zeta function and is one reason the Riemann hypothesis has considerable importance in number theory: if established, it would yield a far better estimate of the error involved in the prime number theorem than is available today.
More specifically, Helge von Koch showed in 1901 that if the Riemann hypothesis is true, the error term in the above relation can be improved to \pi(x) = \operatorname{Li} (x) + O\left(\sqrt x \log x\right) (this last estimate is in fact equivalent to the Riemann hypothesis). The constant involved in the big notation was estimated in 1976 by Lowell Schoenfeld, assuming the Riemann hypothesis: \big|\pi(x) - \operatorname{li}(x)\big| for all .
He also derived a similar bound for the Chebyshev prime-counting function : \big|\psi(x) - x\big| for all . This latter bound has been shown to express a variance to mean power law (when regarded as a random function over the integers) and noise and to also correspond to the Tweedie compound Poisson distribution.
(The Tweedie distributions represent a family of scale invariant distributions that serve as foci of convergence for a generalization of the central limit theorem. ) A lower bound is also derived by J. E. Littlewood, assuming the Riemann hypothesis: \big|\pi(x) - \operatorname{li}(x)\big| = \Omega \left(\sqrt x\frac{\log\log\log x}{\log x} \right) The logarithmic integral is larger than for "small" values of . This is because it is (in some sense) counting not primes, but prime powers, where a power of a prime is counted as of a prime.
This suggests that should usually be larger than by roughly \ \tfrac{1}{2} \operatorname{li}(\sqrt{x})\ , and in particular should always be larger than . However, in 1914, Littlewood proved that \ \pi(x) - \operatorname{li}(x)\ changes sign infinitely often. The first value of where exceeds is probably around ; see the article on Skewes' number for more details.
(On the other hand, the offset logarithmic integral is smaller than already for ; indeed, , while .) In the first half of the twentieth century, some mathematicians (notably G. H. Hardy) believed that there exists a hierarchy of proof methods in mathematics depending on what sorts of numbers (integers, reals, complex) a proof requires, and that the prime number theorem (PNT) is a "deep" theorem by virtue of requiring complex analysis.
This belief was somewhat shaken by a proof of the PNT based on Wiener's tauberian theorem, though Wiener's proof ultimately relies on properties of the Riemann zeta function on the line Re(s)=1 , where complex analysis must be used. In March 1948, Atle Selberg established, by "elementary" means, the asymptotic formula \vartheta ( x )\log ( x ) + \sum\limits_{p \le x} {\log ( p )}\ \vartheta \left( {\frac{x}{p}} \right) = 2x\log ( x ) + O( x ) where \vartheta ( x ) = \sum\limits_{p \le x} {\log ( p )} for primes .
By July of that year, Selberg and Paul Erdős had each obtained elementary proofs of the PNT, both using Selberg's asymptotic formula as a starting point. These proofs effectively laid to rest the notion that the PNT was "deep" in that sense, and showed that technically "elementary" methods were more powerful than had been believed to be the case.
On the history of the elementary proofs of the PNT, including the Erdős–Selberg priority dispute, see an article by Dorian Goldfeld. There is some debate about the significance of Erdős and Selberg's result. There is no rigorous and widely accepted definition of the notion of elementary proof in number theory, so it is not clear exactly in what sense their proof is "elementary".
Although it does not use complex analysis, it is in fact much more technical than the standard proof of PNT. One possible definition of an "elementary" proof is "one that can be carried out in first-order Peano arithmetic."
There are number-theoretic statements (for example, the Paris–Harrington theorem) provable using second order but not first-order methods, but such theorems are rare to date. Erdős and Selberg's proof can certainly be formalized in Peano arithmetic, and in 1994, Charalambos Cornaros and Costas Dimitracopoulos proved that their proof can be formalized in a very weak fragment of PA, namely .
However, this does not address the question of whether or not the standard proof of PNT can be formalized in PA. A more recent "elementary" proof of the prime number theorem uses ergodic theory, due to Florian Richter. The prime number theorem is obtained there in an equivalent form that the Cesàro sum of the values of the Liouville function is zero.
The Liouville function is (-1)^{\omega(n)} where \omega(n) is the number of prime factors, with multiplicity, of the integer n . Bergelson and Richter (2022) then obtain this form of the prime number theorem from an ergodic theorem which they prove: Let X be a compact metric space, T a continuous self-map of X , and \mu a T -invariant Borel probability measure for which T is uniquely ergodic. Then, for every f\in C(X) , \tfrac1N\sum_{n=1}^Nf(T^{\omega(n)}x)\to \int_Xf\,d\mu,\quad\forall x\in X. This ergodic theorem can also be used to give "soft" proofs of results related to the prime number theorem, such as the Pillai–Selberg theorem and Erdős–Delange theorem.
A = \frac{1}{\ 840\ } \quad \text{ if } \quad 3 \leq d \leq 10^4 \quad \text{ and } \quad A = \frac{1}{\ 160\ } \quad \text{ if } \quad d > 10^4 ~, and B = 8 \cdot 10^9 \quad \text{ if } \quad 3 \leq d \leq 10^5 \quad \text{ and } \quad B = \exp(\ 0.03\ \sqrt{d\ }\ (\log{d})^3 \ ) \quad \text{ if } \quad d > 10^5\ . p_n = n B_2(\log n),\text{ where} B_2(x) = x + \log x - 1 + \frac{\log x - 2}{x} - \frac{(\log x)^2 - 6 \log x + 11}{2x^2} + o\left(\frac 1{x^2}\right). Again considering the th prime number , assuming the trailing error term is zero gives an estimate of ; the first 5 digits match and relative error is about 0.46 parts per million.
Cipolla (1902) showed that these are the leading terms of an infinite series which may be truncated at arbitrary degree, with B_k(x) = x + \log x - 1 - \sum_{i=1}^k (-1)^i \frac{P_i(\log x)}{ix^i} + O\left(\frac{(\log x)^{k+1}}{x^{k+1}}\right), where each is a degree- monic polynomial. ( , , , and so on. ) Rosser's theorem states that p_n > n \log n. Dusart (1999). found tighter bounds using the form of the Cesàro/Cipolla approximations but varying the lowest-order constant term. is the same function as above, but with the lowest-order constant term replaced by a parameter : \begin{align} p_n \; &> \; n B_0(\log n; 1) && \text{for } n \ge 2,\text{ and}\\ p_n \; & \; n B_1(\log n; 2.25) && \text{for } n \ge 2,\text{ and}\\ p_n \; & The upper bounds can be extended to smaller by loosening the parameter.
For example, for all . Axler (2019) extended this to higher order, showing: \begin{align} p_n \; &> \; n B_2(\log n;11.321) \quad \text{for } n \ge 2, \text{ and }\\ p_n \; & Again, the bound on may be decreased by loosening the parameter. For example, for .
N_n = \frac{q^n}n + O\left(\frac{q^\frac{n}{2}}{n}\right). The proofs of these statements are far simpler than in the classical case.
It involves a short, combinatorial argument, summarised as follows: every element of the degree extension of is a root of some irreducible polynomial whose degree divides ; by counting these roots in two different ways one establishes that q^n = \sum_{d\mid n} d N_d, where the sum is over all divisors of . Möbius inversion then yields N_n = \frac{1}{n} \sum_{d\mid n} \mu\left(\frac{n}{d}\right) q^d, where is the Möbius function.
(This formula was known to Gauss. ) The main term occurs for , and it is not difficult to bound the remaining terms. The "Riemann hypothesis" statement depends on the fact that the largest proper divisor of can be no larger than . Short video visualizing the Prime Number Theorem.
Prime formulas and Prime number theorem at MathWorld. How Many Primes Are There? and The Gaps between Primes by Chris Caldwell, University of Tennessee at Martin.
Tables of prime-counting functions by Tomás Oliveira e Silva Eberl, Manuel and Paulson, L. C. The Prime Number Theorem (Formal proof development in Isabelle/HOL, Archive of Formal Proofs) The Prime Number Theorem: the "elementary" proof − An exposition of the elementary proof of the Prime Number Theorem of Atle Selberg and Paul Erdős at www.dimostriamogoldbach.it/en/
Text derived from https://en.wikipedia.org/w/index.php?oldid=1377020402 under CC BY-SA 4.0; modifications have been made.