Prime number theorem
Deep within the heart of mathematics lies the Prime Number Theorem, a profound statement that unveils the hidden order in the seemingly chaotic world of prime numbers. It provides a precise mathematical lens, formalizing the fascinating observation that primes become increasingly rare as we explore larger numbers. This elegant theorem quantifies exactly how this thinning occurs, offering a powerful insight into their enigmatic distribution. The Prime Number Theorem quantifies the average spacing of prime numbers, revealing they become less frequent as numbers grow larger. This theorem introduces the prime-counting function, π(x), and provides a surprisingly simple yet accurate approximation for it: x / log x. Proving the Prime Number Theorem required groundbreaking work involving the Riemann zeta function and complex analysis, revolutionizing modern number theory.
AI Summary
Deep within the heart of mathematics lies the Prime Number Theorem, a profound statement that unveils the hidden order in the seemingly chaotic world of prime numbers. It provides a precise mathematical lens, formalizing the fascinating observation that primes become increasingly rare as we explore larger numbers. This elegant theorem quantifies exactly how this thinning occurs, offering a powerful insight into their enigmatic distribution.
- The Prime Number Theorem quantifies the average spacing of prime numbers, revealing they become less frequent as numbers grow larger.
- This theorem introduces the prime-counting function, π(x), and provides a surprisingly simple yet accurate approximation for it: x / log x.
- Proving the Prime Number Theorem required groundbreaking work involving the Riemann zeta function and complex analysis, revolutionizing modern number theory.
The Elusive Primes
Prime numbers are the fundamental building blocks of all integers—numbers greater than one that are only divisible by one and themselves. They are the 'atoms' of arithmetic. Think of 2, 3, 5, 7, 11... they appear somewhat randomly, making their distribution a long-standing mystery for mathematicians.
While individual primes seem to pop up unpredictably, there's a grand pattern to their overall density. As numbers get larger, primes become less common, more spread out. The Prime Number Theorem isn't about where a specific prime is, but how many primes exist up to a certain point, and how that quantity changes.
Counting the Primes: π(x)
To study this, mathematicians use a special function called the prime-counting function, denoted by π(x). No, not the pi from circles! This π(x) simply counts how many prime numbers are less than or equal to a given number x. For example, π(10) is 4, because the primes up to 10 are 2, 3, 5, and 7.
The Prime Number Theorem states that for very large values of x, π(x) is approximately equal to x divided by its natural logarithm, log(x). This approximation gets better and better as x grows, so good that the ratio of the two approaches 1. This is written using the symbol ~ for 'asymptotically equivalent to'.
What does 'asymptotically equivalent' truly mean? It means the relative error between π(x) and x / log x vanishes as x goes to infinity. It doesn't mean their difference gets smaller—in fact, that difference can grow! It's about their ratio converging to one, indicating a precise long-term relationship.
\pi(x) \sim \frac{x}{\log x}This theorem vividly illustrates the 'thinning out' of primes. For instance, a random integer with 2000 digits is about half as likely to be prime as a random integer with 1000 digits. The larger the numbers, the more sparse their prime inhabitants become.
A Centuries-Old Quest
The journey to this theorem was a long one, beginning with observations from numerical tables. In the late 18th century, both Adrien-Marie Legendre and the legendary Carl Friedrich Gauss, independently, conjectured formulas that approximated π(x). Gauss, still a teenager, noticed the pattern early on.
Another significant approximation came from Peter Gustav Lejeune Dirichlet: the logarithmic integral, li(x). While initially expressed as a series, it proved to be a remarkably good estimate for π(x), often outperforming simpler expressions derived from Legendre's initial ideas.
Then came Pafnuty Chebyshev in the mid-19th century. He made groundbreaking progress, using a function closely related to what we now call the Riemann zeta function. Chebyshev couldn't prove the full theorem, but he showed that if the limit existed, it had to be 1, and he provided impressive bounds on the ratio.
The real breakthrough arrived with Bernhard Riemann in 1859. His seminal paper introduced complex analysis into the study of prime numbers, revealing an unexpected deep connection between the distribution of primes and the zeros of a complex function—the Riemann zeta function, ζ(s).
Building directly on Riemann's revolutionary ideas, Jacques Hadamard and Charles Jean de la Vallée Poussin independently proved the Prime Number Theorem in 1896. Their proofs crucially showed that the Riemann zeta function has no zeros on the critical line Re(s) = 1, a deep result in complex analysis.
The Logarithmic Integral: A Finer Approximation
While x / log x is a good approximation, the logarithmic integral function, Li(x) (or li(x)), provides an even tighter fit for π(x). It's defined as an integral, making it inherently linked to the idea that the 'density' of primes around a number t is roughly 1 / log t.
Indeed, for practical purposes, Li(x) is a superior approximation to π(x) than x / log x. In fact, de la Vallée Poussin proved that the error term, or how much π(x) deviates from Li(x), decreases quite rapidly as x grows larger.
\mathrm{Li}(x) = \int_2^x \frac{1}{\log t}\, dtThe connection between the Prime Number Theorem and the Riemann zeta function highlights why the famous Riemann Hypothesis is so important. If proven true, it would provide an astonishingly precise estimate for the error in the Prime Number Theorem, dramatically improving our understanding of prime distribution.
For 'small' numbers, Li(x) is generally larger than π(x). It was long thought it might always be. However, in 1914, J.E. Littlewood proved that π(x) − Li(x) changes sign infinitely often! The first number where π(x) finally overtakes Li(x) is an astronomically large value, known as Skewes' number, estimated to be around 10 to the power of 316.
A Glimpse into the Proof
Most modern proofs of the Prime Number Theorem begin by transforming the problem. Instead of directly counting primes with π(x), mathematicians often work with related functions, like the Chebyshev function ψ(x), which aggregates primes and their powers using logarithms. This function has 'smoother' asymptotic behavior.
The key insight from Riemann is that the properties of ψ(x)—and thus the distribution of primes—are deeply intertwined with the zeros of the Riemann zeta function, ζ(s). This connection allows us to use powerful tools from complex analysis to analyze these otherwise elusive numbers.
This 'explicit formula' for ψ(x) shows a leading term 'x' — exactly what we expect from the Prime Number Theorem! The sum is over all non-trivial zeros of the zeta function, denoted by ρ. Understanding these zeros is central to understanding the error terms in the prime number theorem.
\psi(x) = x - \sum_{\rho} \frac{x^\rho}{\rho} - \log(2\pi) - \frac{1}{2}\log(1-x^{-2})A critical step in the proof, first achieved by Hadamard and de la Vallée Poussin, is demonstrating that the Riemann zeta function has no zeros on the line where the real part of s equals 1. If there were zeros there, the approximation for primes would break down, and the whole theorem would unravel.
For decades, the Prime Number Theorem was considered 'deep' because its proofs relied on advanced complex analysis. However, in 1949, Atle Selberg and Paul Erdős independently found 'elementary' proofs that avoided complex numbers. More recently, in 1980, Donald J. Newman devised a remarkably short, though still 'non-elementary' proof, highlighting the theorem's enduring elegance and depth.
Article
Prime number theorem
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 π(N) ~ N/log(N), where π(N) is the prime-counting function (the number of primes less than or equal to N) and 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 1 / log(N). In other words, the average gap between consecutive prime numbers among the first N integers is roughly 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 2300 is prime (log(101000) ≈ 2302.6), whereas among positive integers of at most 2000 digits, about one in 4600 is prime (log(102000) ≈ 4605.2).
Statement
Prime number theorem
Graph showing ratio of the prime-counting function π(x) to two of its approximations, x / log x and Li(x). As x increases (note x axis is logarithmic), both ratios tend towards 1. The ratio for x / log x converges from above very slowly, while the ratio for Li(x) converges more quickly from below.
Log–log plot showing absolute error of x / log x and Li(x), two approximations to the prime-counting function π(x). Unlike the ratio, the difference between π(x) and x / log x increases without bound as x increases. On the other hand, Li(x) − π(x) switches sign infinitely many times.
Let π(x) be the prime-counting function defined to be the number of primes less than or equal to x, for any real number x. For example, π(10) = 4 because there are four prime numbers (2, 3, 5 and 7) less than or equal to 10. The prime number theorem then states that x / log x is a good approximation to π(x) (where log here means the natural logarithm), in the sense that the limit of the quotient of the two functions π(x) and 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 x / log x approximates π(x) in the sense that the relative error of this approximation approaches 0 as x 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 2×1017th prime number is 8512677386048191063, and (2×1017)log(2×1017) rounds to 7967418752291744388, a relative error of about 6.4%.
On the other hand, the following asymptotic relations are logically equivalent:
${\displaystyle {\begin{aligned}\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{aligned}}}$
As outlined below, 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 ϑ and ψ are the first and the second Chebyshev functions respectively, and to
${\displaystyle \lim {x\to \infty }{\frac {M(x)}{x}}=0,}$
where ${\displaystyle M(x)=\sum {n\leq x}\mu (n)}$ is the Mertens function.
History of the proof of the asymptotic law of prime numbers
Prime number theorem
Based on the tables by Anton Felkel and Jurij Vega, Adrien-Marie Legendre conjectured in 1797 or 1798 that π(a) is approximated by the function a / (A log a + B) , where A and B are unspecified constants. In the second edition of his book on number theory (1808) he then made a more precise conjecture, with A = 1 and B = −1.08366 . Carl Friedrich Gauss considered the same question at age 15 or 16 "in the year 1792 or 1793", according to his own recollection in 1849. In 1838 Peter Gustav Lejeune Dirichlet came up with his own approximating function, the logarithmic integral li(x) (under the slightly different form of a series, which he communicated to Gauss). Both Legendre's and Dirichlet's formulas imply the same conjectured asymptotic equivalence of π(x) and x / log(x) stated above, although it turned out that Dirichlet's approximation is considerably better if one considers the differences instead of quotients.
In two papers from 1848 and 1850, the Russian mathematician Pafnuty Chebyshev attempted to prove the asymptotic law of distribution of prime numbers. His work is notable for the use of the zeta function ζ(s), for real values of the argument "s", as in works of Leonhard Euler, as early as 1737. Chebyshev's papers predated Riemann's celebrated memoir of 1859, and he succeeded in proving a slightly weaker form of the asymptotic law, namely, that if the limit as x goes to infinity of π(x) / (x / log(x)) exists at all, then it is necessarily equal to one. He was able to prove unconditionally that this ratio is bounded above and below by 0.92129 and 1.10555, for all sufficiently large x. Although Chebyshev's paper did not prove the Prime Number Theorem, his estimates for π(x) were strong enough for him to prove Bertrand's postulate that there exists a prime number between n and 2n for any integer n ≥ 2.
An important paper concerning the distribution of prime numbers was Riemann's 1859 memoir "On the Number of Primes Less Than a Given Magnitude", the only paper he ever wrote on the subject. Riemann introduced new ideas into the subject, chiefly that the distribution of prime numbers is intimately connected with the zeros of the analytically extended Riemann zeta function of a complex variable. In particular, it is in this paper that the idea to apply methods of complex analysis to the study of the real function π(x) originates. Extending Riemann's ideas, two proofs of the asymptotic law of the distribution of prime numbers were found independently by Jacques Hadamard and Charles Jean de la Vallée Poussin and appeared in the same year (1896). Both proofs used methods from complex analysis, establishing as a main step of the proof that the Riemann zeta function ζ(s) is nonzero for all complex values of the variable s that have the form s = 1 + it with t > 0 .
During the 20th century, the theorem of Hadamard and de la Vallée Poussin also became known as the Prime Number Theorem. Several different proofs of it were found, including the "elementary" proofs of Atle Selberg (1949) and Paul Erdős (1949). Hadamard's and de la Vallée Poussin's original proofs are long and elaborate; later proofs introduced various simplifications through the use of Tauberian theorems but remained difficult to digest. A short proof was discovered in 1980 by the American mathematician Donald J. Newman. Newman's proof is arguably the simplest known proof of the theorem, although it is not "elementary" since it uses Cauchy's integral theorem from complex analysis.
Proof sketch
Prime number theorem
Here is a sketch of the proof referred to in one of Terence Tao's lectures. Like most proofs of the PNT, it starts out by reformulating the problem in terms of a less intuitive, but better-behaved, prime-counting function. The idea is to count the primes (or a related set such as the set of prime powers) with weights to arrive at a function with smoother asymptotic behavior. The most common such generalized counting function is the Chebyshev function ψ(x), defined by
${\displaystyle \psi (x)=\sum {k\geq 1}\sum {\overset {p^{k}\leq x,}{\!\!\!\!p{\text{ is prime}}\!\!\!\!}}\log p\;.}$
${\displaystyle \psi (x)=\sum {n\leq x}\Lambda (n)\;,}$
where Λ(n) is the von Mangoldt function, namely
${\displaystyle \Lambda (n)={\begin{cases}\log p&{\text{ if }}n=p^{k}{\text{ for some prime }}p{\text{ and integer }}k\geq 1,\\0&{\text{otherwise.}}\end{cases}}}$
It is now relatively easy to check that the PNT is equivalent to the claim that
${\displaystyle \lim {x\to \infty }{\frac {\psi (x)}{x}}=1\;.}$
${\displaystyle \psi (x)=\sum {\overset {p\leq x}{\!\!\!\!p{\text{ is prime}}\!\!\!\!}}\log p\left\lfloor {\frac {\log x}{\log p}}\right\rfloor \leq \sum {\overset {p\leq x}{\!\!\!\!p{\text{ is prime}}\!\!\!\!}}\log x=\pi (x)\log x}$
and (using big O notation) for any ε > 0,
${\displaystyle \psi (x)\geq \sum {\!\!\!\!{\overset {x^{1-\varepsilon }\leq p\leq x}{p{\text{ is prime}}}}\!\!\!\!}\log p\geq \sum {\!\!\!\!{\overset {x^{1-\varepsilon }\leq p\leq 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 ψ(x). Let ζ(s) be the Riemann zeta function. It can be shown that ζ(s) is related to the von Mangoldt function Λ(n), and hence to ψ(x), via the relation
${\displaystyle -{\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 x the equation
${\displaystyle \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 x (claimed to be the correct asymptotic order of ψ(x)) 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:
${\displaystyle \sum {n=1}^{\infty }{\frac {1}{2n\,x^{2n}}}=-{\frac {1}{2}}\log \left(1-{\frac {1}{x^{2}}}\right),}$
which vanishes for large x. The nontrivial zeros, namely those on the critical strip 0 ≤ Re(s) ≤ 1, can potentially be of an asymptotic order comparable to the main term x if Re(ρ) = 1, 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 ζ(s) is meromorphic in the half-plane Re(s) > 0, and is analytic there except for a simple pole at s = 1, and that there is a product formula
${\displaystyle \zeta (s)=\prod {p}{\frac {1}{1-p^{-s}}}}$
for Re(s) > 1. This product formula follows from the existence of unique prime factorization of integers, and shows that ζ(s) is never zero in this region, so that its logarithm is defined there and
${\displaystyle \log \zeta (s)=-\sum {p}\log \left(1-p^{-s}\right)=\sum {p,n}{\frac {p^{-ns}}{n}}\;.}$
${\displaystyle {\big |}\zeta (x+iy){\big |}=\exp \left(\sum {n,p}{\frac {\cos ny\log p}{np^{nx}}}\right)\;.}$
${\displaystyle 3+4\cos \phi +\cos 2\phi =2(1+\cos \phi )^{2}\geq 0\;,}$
${\displaystyle \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(2ny\log p)}{np^{nx}}}\right)\geq 1}$
for all x > 1. Suppose now that ζ(1 + iy) = 0. Certainly y is not zero, since ζ(s) has a simple pole at s = 1. Suppose that x > 1 and let x tend to 1 from above. Since ${\displaystyle \zeta (s)}$ has a simple pole at s = 1 and ζ(x + 2iy) 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 ψ(x) 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.
Newman's proof of the prime number theorem
Prime number theorem
D.J. Newman gives a quick proof of the prime number theorem (PNT). The proof is "non-elementary" by virtue of relying on complex analysis, but uses only elementary techniques from a first course in the subject: Cauchy's integral formula, Cauchy's integral theorem and estimates of complex integrals. Here is a brief sketch of this proof. See for the complete details.
The proof uses the same preliminaries as in the previous section except instead of the function ${\textstyle \ \psi \ ,}$ the Chebyshev function ${\textstyle \ \vartheta (x)=\sum {p\leq x}\log p\ }$ is used, which is obtained by dropping some of the terms from the series for ${\textstyle \ \psi ~.}$ Similar to the argument in the previous proof based on Tao's lecture, we can show that ϑ(x) ≤ π(x) log x , and ϑ(x) ≥ ( 1 − ɛ )( π(x) + O( x1 − ɛ ) ) log x for any 0 < ɛ < 1 . Thus, the PNT is equivalent to ${\displaystyle \ \lim {x\to \infty }{\tfrac {\ \vartheta (x)\ }{x}}=1~.}$ Likewise instead of ${\displaystyle \ -{\tfrac {\ \zeta '(s)\ }{\zeta (s)}}\ }$ the function ${\displaystyle \ \Phi (s)=\sum {p\leq x}{\tfrac {\ \log p\ }{\;p^{s}\ }}\ }$ is used, which is obtained by dropping some terms in the series for ${\displaystyle \ -{\tfrac {\ \zeta '(s)\ }{\zeta (s)}}~.}$ The functions ${\displaystyle \ \Phi (s)\ }$ and ${\displaystyle \ -{\tfrac {\ \zeta '(s)\ }{\zeta (s)}}\ }$ differ by a function holomorphic on ${\displaystyle \ \Re (s)=1~.}$ Since, as was shown in the previous section, ${\displaystyle \ \zeta (s)\ }$ has no zeroes on the line ${\displaystyle \ \Re =1\ ,}$ and ${\displaystyle \ \Phi (s)-{\tfrac {1}{\ s-1\ }}\ }$ has no singularities on ${\displaystyle \ \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 ${\displaystyle \ {\tfrac {\ \vartheta (x)\ }{x}}\ }$ is bounded. This is proved using an ingenious and easy method due to Chebyshev.
Integration by parts shows how ${\displaystyle \ \vartheta (x)\ }$ and ${\displaystyle \ \Phi (s)\ }$ are related: For ${\displaystyle \ \Re (s)>1\ ,}$
${\displaystyle \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
${\displaystyle 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 ${\displaystyle \ 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 ${\displaystyle \ \vartheta \ }$ is increasing, it is easy to show in this case.
To show the convergence of ${\displaystyle \ I\ ,}$ for ${\displaystyle \ \Re (z)>0\ }$ let
${\displaystyle g{T}(z)\equiv \int {0}^{T}f(t)\ e^{-zt}\operatorname {d} t\quad }$ and ${\displaystyle \quad g(z)\equiv \int {0}^{\infty }f(t)\ e^{-zt}\operatorname {d} t\quad }$ where ${\displaystyle \quad f(t)\equiv {\frac {\ \vartheta (e^{t})\ }{e^{t}}}-1\ }$
${\displaystyle \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 ${\displaystyle \ \Re (z)=0~.}$
The convergence of the integral ${\displaystyle \ I\ ,}$ and thus the PNT, is proved by showing that ${\displaystyle \ \lim {T\to \infty }g{T}(0)~=~g(0)~.}$ This involves change of order of limits since it can be written ${\textstyle \ \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 ${\displaystyle \ g(0)-g{T}(0)\ }$ is expressed using Cauchy's integral formula and then shown to be small for large ${\displaystyle \ T\ }$ by estimating the integrand: Fix ${\displaystyle \ R>0\ }$ and ${\displaystyle \ \delta >0\ }$ so that ${\displaystyle \ g(z)\ }$ is holomorphic in the region where ${\displaystyle \ |z|\leq R~}$ and ${\displaystyle ~\Re (z)\geq -\delta \ ,}$ and let ${\displaystyle \ C\ }$ be the boundary of that region. Since 0 is in the interior of the region, Cauchy's integral formula gives
${\displaystyle 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 ${\displaystyle \ 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 ${\displaystyle \ F\ }$ is entire and ${\displaystyle \ F(0)=1~.}$
To estimate the integral, break the contour ${\displaystyle \ C\ }$ into two parts, ${\displaystyle \ C=C{+}+C{-}\ }$ where ${\displaystyle \ C{+}\equiv C\cap \left\{z\ \vert \ \Re (z)>0\right\}\ }$ and ${\displaystyle \ C{-}\equiv C\cap \left\{z\ \vert \ \Re (z)\leq 0\right\}~.}$ Then
${\displaystyle \ 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 iz\ }}\ ,}$
where ${\displaystyle \ H(t,z)\equiv f(t)\ e^{-tz}{\frac {F(z)}{\ 2\pi i\ }}~.}$ Note that ${\displaystyle \ {\frac {\ \vartheta (x)\ }{x}}\ ,}$ and hence ${\displaystyle \ f(t)\ ,}$ are bounded; so let ${\displaystyle \ B\ }$ be some upper bound: ${\displaystyle \ B\geq {\bigl |}f(t){\bigr |}~.}$
This bound, combined with the estimate ${\displaystyle \ \left|F\right|\ \leq \ 2\ \exp \!{\Bigl (}T\ \Re (z){\Bigr )}{\frac {\ \left|\Re (z)\right|\ }{R}}\ }$ for ${\displaystyle \ |z|=R\ ,}$ together give that the absolute value of the first integral must be ${\displaystyle \ \leq {\frac {\ B\ }{R}}~.}$ The integrand over ${\displaystyle \ C{-}\ }$ in the second integral is entire, so by Cauchy's integral theorem, the contour ${\displaystyle \ C{-}\ }$ can be modified to a semicircle of radius ${\displaystyle \ 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 ${\displaystyle \ \leq {\frac {\ B\ }{R}}~.}$ Finally, letting ${\displaystyle \ T\to \infty \ ,}$ the third integral goes to zero since ${\displaystyle \ e^{zT}\ }$ and hence ${\displaystyle \ F\ }$ goes to zero on the contour. Combining the two estimates and the limit get
${\displaystyle \limsup {T\to \infty }\ {\bigl |}\ g(0)-g{T}(0)\ {\bigr |}\ \leq \ {\frac {\ 2B\ }{R}}\ ~.}$
This holds for any ${\displaystyle \ R\ }$ so ${\displaystyle \ \lim {T\to \infty }g{T}(0)=g(0)\ ,}$ and the PNT follows.
Prime-counting function in terms of the logarithmic integral
Prime number theorem
In a handwritten note on a reprint of his 1838 paper "Sur l'usage des séries infinies dans la théorie des nombres", which he mailed to Gauss, Dirichlet conjectured (under a slightly different form appealing to a series rather than an integral) that an even better approximation to π(x) is given by the offset logarithmic integral function Li(x), defined by
${\displaystyle \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 t should be 1 / log t. This function is related to the logarithm by the asymptotic expansion
${\displaystyle \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 π(x) ~ Li(x). In fact, in another paper in 1899 de la Vallée Poussin proved that
${\displaystyle \pi (x)=\operatorname {Li} (x)+O\left(xe^{-a{\sqrt {\log x}}}\right)\quad {\text{as }}x\to \infty }$
for some positive constant a, where O(...) is the big O notation. This has been improved to
${\displaystyle \pi (x)=\operatorname {li} (x)+O\left(x\exp \left(-{\frac {A(\log x)^{\frac {3}{5}}}{(\log \log x)^{\frac {1}{5}}}}\right)\right)}$ where ${\displaystyle A=0.2098}$.
In 2016, Timothy Trudgian proved an explicit upper bound for the difference between ${\displaystyle \pi (x)}$ and ${\displaystyle \operatorname {li} (x)}$:
${\displaystyle {\big |}\pi (x)-\operatorname {li} (x){\big |}\leq 0.2795{\frac {x}{(\log x)^{3/4}}}\exp \left(-{\sqrt {\frac {\log x}{6.455}}}\right)}$
The connection between the Riemann zeta function and π(x) 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
${\displaystyle \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 O notation was estimated in 1976 by Lowell Schoenfeld, assuming the Riemann hypothesis:
${\displaystyle {\big |}\pi (x)-\operatorname {li} (x){\big |}<{\frac {{\sqrt {x}}\log x}{8\pi }}}$
for all x ≥ 2657. He also derived a similar bound for the Chebyshev prime-counting function ψ:
${\displaystyle {\big |}\psi (x)-x{\big |}<{\frac {{\sqrt {x}}(\log x)^{2}}{8\pi }}}$
for all x ≥ 73.2 . This latter bound has been shown to express a variance to mean power law (when regarded as a random function over the integers) and 1/ f 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:
${\displaystyle {\big |}\pi (x)-\operatorname {li} (x){\big |}=\Omega \left({\sqrt {x}}{\frac {\log \log \log x}{\log x}}\right)}$
The logarithmic integral li(x) is larger than π(x) for "small" values of x. This is because it is (in some sense) counting not primes, but prime powers, where a power pn of a prime p is counted as 1/ n of a prime. This suggests that li(x) should usually be larger than π(x) by roughly ${\displaystyle \ {\tfrac {1}{2}}\operatorname {li} ({\sqrt {x}})\ ,}$ and in particular should always be larger than π(x). However, in 1914, Littlewood proved that ${\displaystyle \ \pi (x)-\operatorname {li} (x)\ }$ changes sign infinitely often. The first value of x where π(x) exceeds li(x) is probably around x ~ 10316 ; see the article on Skewes' number for more details. (On the other hand, the offset logarithmic integral Li(x) is smaller than π(x) already for x = 2; indeed, Li(2) = 0, while π(2) = 1.)
Elementary proofs
Prime number theorem
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 ${\displaystyle Re(s)=1}$, where complex analysis must be used.
In March 1948, Atle Selberg established, by "elementary" means, the asymptotic formula
${\displaystyle \vartheta (x)\log(x)+\sum \limits {p\leq x}{\log(p)}\ \vartheta \left({\frac {x}{p}}\right)=2x\log(x)+O(x)}$
${\displaystyle \vartheta (x)=\sum \limits {p\leq x}{\log(p)}}$
for primes p. 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 IΔ0 + exp. 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 ${\displaystyle (-1)^{\omega (n)}}$ where ${\displaystyle \omega (n)}$ is the number of prime factors, with multiplicity, of the integer ${\displaystyle n}$. Bergelson and Richter (2022) then obtain this form of the prime number theorem from an ergodic theorem which they prove:
Let ${\displaystyle X}$ be a compact metric space, ${\displaystyle T}$ a continuous self-map of ${\displaystyle X}$, and ${\displaystyle \mu }$ a ${\displaystyle T}$-invariant Borel probability measure for which ${\displaystyle T}$ is uniquely ergodic. Then, for every ${\displaystyle f\in C(X)}$,
${\displaystyle {\tfrac {1}{N}}\sum {n=1}^{N}f(T^{\omega (n)}x)\to \int {X}f\,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.
Computer verifications
Prime number theorem
In 2005, Avigad et al. employed the Isabelle theorem prover to devise a computer-verified variant of the Erdős–Selberg proof of the PNT. This was the first machine-verified proof of the PNT. Avigad chose to formalize the Erdős–Selberg proof rather than an analytic one because while Isabelle's library at the time could implement the notions of limit, derivative, and transcendental function, it had almost no theory of integration to speak of.
In 2009, John Harrison employed HOL Light to formalize a proof employing complex analysis. By developing the necessary analytic machinery, including the Cauchy integral formula, Harrison was able to formalize "a direct, modern and elegant proof instead of the more involved 'elementary' Erdős–Selberg argument".
Prime number theorem for arithmetic progressions
Prime number theorem
Let πd,a(x) denote the number of primes in the arithmetic progression a, a + d, a + 2d, a + 3d, ... that are less than x. Dirichlet and Legendre conjectured, and de la Vallée Poussin proved, that if a and d are coprime, then
${\displaystyle \pi {d,a}(x)\sim {\frac {\operatorname {Li} (x)}{\varphi (d)}}\ ,}$
where φ is Euler's totient function. In other words, the primes are distributed evenly among the residue classes [a] modulo d with gcd(a, d) = 1 . This is stronger than Dirichlet's theorem on arithmetic progressions (which only states that there is an infinity of primes in each class) and can be proved using similar methods used by Newman for his proof of the prime number theorem.
The Siegel–Walfisz theorem gives a good estimate for the distribution of primes in residue classes.
Bennett et al. proved the following estimate that has explicit constants A and B (Theorem 1.3): Let d ${\displaystyle \geq 3}$ be an integer and let a be an integer that is coprime to d. Then there are positive constants A and B such that
${\displaystyle \left|\pi {d,a}(x)-{\frac {\ \operatorname {Li} (x)\ }{\ \varphi (d)\ }}\right|<{\frac {A\ x}{\ (\log x)^{2}\ }}\quad {\text{ for all }}\quad x\geq B\ ,}$
${\displaystyle 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}~,}$
${\displaystyle 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}\ .}$
Prime number race
Plot of the function ${\displaystyle \ \pi (x;4,3)-\pi (x;4,1)\ }$ for n ≤ 30000
${\displaystyle \pi {4,1}(x)\sim \pi {4,3}(x)\ ,}$
empirically the primes congruent to 3 are more numerous and are nearly always ahead in this "prime number race"; the first reversal occurs at x = 26861. However Littlewood showed in 1914 that there are infinitely many sign changes for the function
so the lead in the race switches back and forth infinitely many times. The phenomenon that π4,3(x) is ahead most of the time is called Chebyshev's bias. The prime number race generalizes to other moduli and is the subject of much research; Pál Turán asked whether it is always the case that πc,a(x) and πc,b(x) change places when a and b are coprime to c. Granville and Martin give a thorough exposition and survey.
Graph of the number of primes ending in 1, 3, 7, and 9 up to n for n < 10000
Another example is the distribution of the last digit of prime numbers. Except for 2 and 5, all prime numbers end in 1, 3, 7, or 9. Dirichlet's theorem states that asymptotically, 25% of all primes end in each of these four digits. However, empirical evidence shows that, for a given limit, there tend to be slightly more primes that end in 3 or 7 than end in 1 or 9 (a generation of the Chebyshev's bias). This follows that 1 and 9 are quadratic residues modulo 10, and 3 and 7 are quadratic nonresidues modulo 10.
Non-asymptotic bounds on the prime-counting function
Prime number theorem
The prime number theorem is an asymptotic result. It gives an ineffective bound on π(x) as a direct consequence of the definition of the limit: for all ε > 0, there is an S such that for all x > S,
${\displaystyle (1-\varepsilon ){\frac {x}{\log x}}\;<\;\pi (x)\;<\;(1+\varepsilon ){\frac {x}{\log x}}\;.}$
However, better bounds on π(x) are known, for instance Pierre Dusart's
${\displaystyle {\frac {x}{\log x}}\left(1+{\frac {1}{\log x}}\right)\;<\;\pi (x)\;<\;{\frac {x}{\log x}}\left(1+{\frac {1}{\log x}}+{\frac {2.51}{(\log x)^{2}}}\right)\;.}$
The first inequality holds for all x ≥ 599 and the second one for x ≥ 355991.
The proof by de la Vallée Poussin implies the following bound: For every ε > 0, there is an S such that for all x > S,
${\displaystyle {\frac {x}{\log x-(1-\varepsilon )}}\;<\;\pi (x)\;<\;{\frac {x}{\log x-(1+\varepsilon )}}\;.}$
The value ε = 3 gives a weak but sometimes useful bound for x ≥ 55:
${\displaystyle {\frac {x}{\log x+2}}\;<\;\pi (x)\;<\;{\frac {x}{\log x-4}}\;.}$
In Pierre Dusart's thesis there are stronger versions of this type of inequality that are valid for larger x. Later in 2010, Dusart proved:
${\displaystyle {\begin{aligned}{\frac {x}{\log x-1}}\;&<\;\pi (x)&&{\text{ for }}x\geq 5393\;,{\text{ and }}\\\pi (x)&<\;{\frac {x}{\log x-1.1}}&&{\text{ for }}x\geq 60184\;.\end{aligned}}}$
Note that the first of these obsoletes the ε > 0 condition on the lower bound.
Approximations for the nth prime number
Prime number theorem
As a consequence of the prime number theorem, one gets an asymptotic expression for the nth prime number, denoted by pn:
A better approximation is by Cesàro (1894):
${\displaystyle p{n}=nB{2}(\log n),{\text{ where}}}$ ${\displaystyle 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 2×1017th prime number 8512677386048191063, assuming the trailing error term is zero gives an estimate of 8512681315554715386; 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
${\displaystyle 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 Pi is a degree-i monic polynomial. (P1(y) = y − 2, P2(y) = y2 − 6y + 11, P3(y) = y3 − 21/2y2 + 42y + 131/2, and so on.)
Rosser's theorem states that
Dusart (1999). found tighter bounds using the form of the Cesàro/Cipolla approximations but varying the lowest-order constant term. Bk(x; C) is the same function as above, but with the lowest-order constant term replaced by a parameter C:
${\displaystyle {\begin{aligned}p{n}\;&>\;nB{0}(\log n;1)&&{\text{for }}n\geq 2,{\text{ and}}\\p{n}\;&<\;nB{0}(\log n;0.9484)&&{\text{for }}n\geq 39017,{\text{ where}}\\B{0}(x;C)\;&=\;x+\log x-C.\\p{n}\;&>\;nB{1}(\log n;2.25)&&{\text{for }}n\geq 2,{\text{ and}}\\p{n}\;&<\;nB{1}(\log n;1.8)&&{\text{for }}n\geq 27076,{\text{ where}}\\B{1}(x;C)\;&=\;x+\log x-1+{\frac {\log x-C}{x}}.\end{aligned}}}$
The upper bounds can be extended to smaller n by loosening the parameter. For example, pn < n B1(log n; 0.5) for all n ≥ 20.
Axler (2019) extended this to higher order, showing:
${\displaystyle {\begin{aligned}p{n}\;&>\;nB{2}(\log n;11.321)\quad {\text{for }}n\geq 2,{\text{ and }}\\p{n}\;&<\;nB{2}(\log n;10.667)\quad {\text{for }}n\geq 46\,254\,381,{\text{ where}}\\B{2}(x;C)\;&=\;x+\log x-1+{\frac {\log x-2}{x}}-{\frac {(\log x)^{2}-6\log x+C}{2x^{2}}}.\end{aligned}}}$
Again, the bound on n may be decreased by loosening the parameter. For example, pn < n B2(log n; 0) for n ≥ 3468.
Table of π(x), x / log x, and li(x)
Prime number theorem
The table compares exact values of π(x) to the two approximations x / log x and li(x). The approximation difference columns are rounded to the nearest integer, but the "% error" columns are computed based on the unrounded approximations. The last column, x / π(x), is the average prime gap below x.
The value for π(1024) was originally computed assuming the Riemann hypothesis; it has since been verified unconditionally.
Analogue for irreducible polynomials over a finite field
Prime number theorem
There is an analogue of the prime number theorem that describes the "distribution" of irreducible polynomials over a finite field; the form it takes is strikingly similar to the case of the classical prime number theorem.
To state it precisely, let F = GF(q) be the finite field with q elements, for some fixed q, and let Nn be the number of monic irreducible polynomials over F whose degree is equal to n. That is, we are looking at polynomials with coefficients chosen from F, which cannot be written as products of polynomials of smaller degree. In this setting, these polynomials play the role of the prime numbers, since all other monic polynomials are built up of products of them. One can then prove that
If we make the substitution x = qn, then the right hand side is just
which makes the analogy clearer. Since there are precisely qn monic polynomials of degree n (including the reducible ones), this can be rephrased as follows: if a monic polynomial of degree n is selected randomly, then the probability of it being irreducible is about 1/n.
One can even prove an analogue of the Riemann hypothesis, namely that
${\displaystyle 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 n extension of F is a root of some irreducible polynomial whose degree d divides n; by counting these roots in two different ways one establishes that
where the sum is over all divisors d of n. Möbius inversion then yields
${\displaystyle N{n}={\frac {1}{n}}\sum {d\mid n}\mu \left({\frac {n}{d}}\right)q^{d},}$
where μ(k) is the Möbius function. (This formula was known to Gauss.) The main term occurs for d = n, and it is not difficult to bound the remaining terms. The "Riemann hypothesis" statement depends on the fact that the largest proper divisor of n can be no larger than n/2.