# Prime number theorem

Last updated

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 1896 using ideas introduced by Bernhard Riemann (in particular, the Riemann zeta function).

## Contents

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). 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). In other words, the average gap between consecutive prime numbers among the first N integers is roughly log(N). [1]

## Statement

Let π(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, π(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

${\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 2×1017th prime number is 8512677386048191063, [2] and (2×1017)log(2×1017) rounds to 7967418752291744388, a relative error of about 6.4%.

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.

## History of the proof of the asymptotic law of prime numbers

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. [3] 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. [4] He was able to prove unconditionally that this ratio is bounded above and below by two explicitly given constants near 1, for all sufficiently large x. [5] 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. [6]

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 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. [7] [8] Newman's proof is arguably the simplest known proof of the theorem, although it is non-elementary in the sense that it uses Cauchy's integral theorem from complex analysis.

## Proof sketch

Here is a sketch of the proof referred to in one of Terence Tao's lectures. [9] 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 _{\stackrel {p^{k}\leq x,}{p{\text{ is prime}}}}\!\!\!\!\log p.}$

This is sometimes written as

${\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.}$

Indeed, this follows from the easy estimates

${\displaystyle \psi (x)=\sum _{p\leq x}\log p\left\lfloor {\frac {\log x}{\log p}}\right\rfloor \leq \sum _{p\leq x}\log x=\pi (x)\log x}$

and (using big O notation) for any ε > 0,

${\displaystyle \psi (x)\geq \!\!\!\!\sum _{x^{1-\varepsilon }\leq p\leq x}\!\!\!\!\log p\geq \!\!\!\!\sum _{x^{1-\varepsilon }\leq p\leq x}\!\!\!\!(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-\sum _{\rho }{\frac {x^{\rho }}{\rho }}-\log(2\pi )}$

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 a 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}}.}$

Write s = x + iy; then

${\displaystyle {\big |}\zeta (x+iy){\big |}=\exp \left(\sum _{n,p}{\frac {\cos ny\log p}{np^{nx}}}\right).}$

Now observe the identity

${\displaystyle 3+4\cos \phi +\cos 2\phi =2(1+\cos \phi )^{2}\geq 0,}$

so that

${\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 [10] 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

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 the critical estimate 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:

The first and second Chebyshev function are respectively

${\displaystyle \psi (x)=\sum _{k\geq 1}\sum _{p^{k}\leq x}\log p\quad {\text{ and }}\quad \vartheta (x)=\sum _{p\leq x}\log p.}$

The second series is obtained by dropping the terms with ${\displaystyle k\geq 2}$ from the first one. PNT is equivalent to either ${\displaystyle \lim _{x\to \infty }\psi (x)/x=1}$ or ${\displaystyle \lim _{x\to \infty }\vartheta (x)/x=1}$ .

The sums for ${\displaystyle \psi }$ and ${\displaystyle \vartheta }$ are partial sums of the coefficients of the Dirichlet series

${\displaystyle -{\frac {\zeta '(s)}{\zeta (s)}}=\sum _{k\geq 1}\sum _{p^{k}\leq x}\log p\,\,p^{-ks}\quad {\text{ and }}\quad \quad \Phi (s)=\sum _{p\leq x}\log p\,\,p^{-s},}$

where ${\displaystyle \zeta }$ is the Riemann zeta function. As with the partial sums, the second series is obtained by dropping the terms with ${\displaystyle k\geq 2}$ from the first one. The Dirichlet series formed by terms with ${\displaystyle k\geq 2}$ is dominated by the Dirichlet series for ${\displaystyle \zeta (2s+\varepsilon )}$ for any positive ${\displaystyle \varepsilon }$ , so the logarithmic derivative of ${\displaystyle \zeta }$ and ${\displaystyle \Phi (s)}$ differ by a function holomorphic in ${\displaystyle \Re s>{\frac {1}{2}}}$ , and therefore have the same singularities on the line ${\displaystyle \Re s=1}$ .

Integration by parts gives for ${\displaystyle \Re s>1}$ ,

${\displaystyle \Phi (s)=\int _{1}^{\infty }x^{-s}d\vartheta (x)=s\int _{1}^{\infty }\vartheta (x)x^{-s-1}\,dx=s\int _{0}^{\infty }\vartheta (e^{t})e^{-st}\,dt.}$

All analytic proofs of the Prime Number Theorem use the fact that ${\displaystyle \zeta }$ has no zeroes on the line ${\displaystyle \Re s=1}$ . One further piece of information needed in Newman's proof is that ${\displaystyle \vartheta (x)/x}$ is bounded. This can be easily proved using elementary methods.

Newman's method proves PNT by showing the integral

${\displaystyle I=\int _{0}^{\infty }\left({\frac {\vartheta (e^{t})}{e^{t}}}-1\right)\,dt.}$

converges, and therefore the integrand goes to zero as ${\displaystyle t\to \infty }$ . In general, the convergence of the improper integral does not imply that the integrand goes to zero, since it may oscillate, but since ${\displaystyle \vartheta }$ is increasing, it is easy to show in this case.

For ${\displaystyle \Re z>0}$ let

${\displaystyle g_{T}(z)=\int _{0}^{T}\left({\frac {\vartheta (e^{t})}{e^{t}}}-1\right)e^{-zt}\,dt\quad \quad }$

then

${\displaystyle \lim _{T\to \infty }g_{T}(z)=g(z)={\frac {\Phi (s)}{s}}-{\frac {1}{s-1}}\quad \quad {\text{where}}\quad z=s-1}$

which is holomorphic on the line ${\displaystyle \Re z=0}$ . The convergence of the integral ${\displaystyle I}$ 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

${\displaystyle \lim _{T\to \infty }\lim _{s\to 0}g_{T}(z)=\lim _{s\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 estimates are applied to the integral. Fix ${\displaystyle R>0}$ and ${\displaystyle \delta >0}$ such that ${\displaystyle g(z)}$ is holomorphic in the region where ${\displaystyle |z|\leq R{\text{ and }}\Re z\geq -\delta }$ and let ${\displaystyle C}$ be its boundary. Since 0 is in the interior, Cauchy's integral formula gives

${\displaystyle g(0)-g_{T}(0)={\frac {1}{2\pi i}}\int _{C}\left(g(z)-g_{T}(z)\right){\frac {dz}{z}}.}$

To get a rough estimate on the integrand, let ${\displaystyle B}$ be an upper bound for ${\displaystyle \vartheta (e^{t})/{e^{t}}-1}$ , then for ${\displaystyle \Re z>0}$

${\displaystyle |g(z)-g_{T}(z)|\leq B\int _{T}^{\infty }e^{-\Re (z)t}\,dt={\frac {Be^{-\Re (z)T}}{\Re z}}.}$

This bound is not good enough to prove the result, but Newman introduces the factor

${\displaystyle F(z)=e^{zT}\left(1+{\frac {z^{2}}{R^{2}}}\right)}$

into the integrand for ${\displaystyle g(0)-g_{T}(0)}$ . Since the Newman factor ${\displaystyle F}$ is entire and ${\displaystyle F(0)=1}$ , the left side remains unchanged. Now the estimate above for ${\displaystyle |g(z)-g_{T}(z)|}$ and estimates on ${\displaystyle F}$ combine to give

${\displaystyle \left|{\frac {1}{2\pi i}}\int _{C_{+}}\left(g(z)-g_{T}(z)\right)F(z){\frac {dz}{z}}\right|\leq {\frac {B}{R}}.}$

where ${\displaystyle C_{+}}$ is the semicircle ${\displaystyle C\cap \left\{z\,\vert \,\Re z>0\right\}}$ .

Let ${\displaystyle C_{-}}$ be the contour ${\displaystyle C\cap \left\{\Re z\leq 0\right\}}$ . The function ${\displaystyle g_{T}}$ 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 of ${\displaystyle g_{T}(z)F(z)/2\pi iz}$ , and the same argument gives the absolute value of this integral as ${\displaystyle \leq B/R}$ . Finally, letting ${\displaystyle T\to \infty }$ , the integral of ${\displaystyle g(z)F(z)/z}$ over the contour ${\displaystyle C_{\delta }}$ goes to zero since ${\displaystyle F}$ goes to zero on the contour. Combining the three estimates, get

${\displaystyle \limsup _{T\to \infty }|g(0)-g_{T}(0)|\leq {\frac {2B}{R}}.}$

This holds for any ${\displaystyle R}$ so ${\displaystyle \lim _{T\to \infty }g_{T}(0)=g(0)}$, and PNT follows.

## Prime-counting function in terms of the logarithmic integral

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}$. [11]

In 2016, 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)}$

for ${\displaystyle x\geq 229}$. [12]

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 [13] 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: [14] 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. [15] )

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 li(x) / 2, and in particular should always be larger than π(x). However, in 1914, J. E. Littlewood proved that ${\displaystyle \pi (x)-\operatorname {li} (x)}$ changes sign infinitely often. [16] 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

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. [17] This belief was somewhat shaken by a proof of the PNT based on Wiener's tauberian theorem, though this could be set aside if Wiener's theorem were deemed to have a "depth" equivalent to that of complex variable methods.

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)}$

where

${\displaystyle \vartheta (x)=\sum \limits _{p\leq x}{\log(p)}}$

for primes p. [18] 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. [17] [19] 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. [17]

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. [20] However, this does not address the question of whether or not the standard proof of PNT can be formalized in PA.

## Computer verifications

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. [21] 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. [21] :19

In 2009, John Harrison employed HOL Light to formalize a proof employing complex analysis. [22] 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

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 {1}{\varphi (d)}}\operatorname {Li} (x),}$

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. [23]

The Siegel–Walfisz theorem gives a good estimate for the distribution of primes in residue classes.

Bennett et al. [24] 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| for all ${\displaystyle x\geq B}$,

where

${\displaystyle A={\frac {1}{840}}}$ if ${\displaystyle 3\leq d\leq 10^{4}}$ and ${\displaystyle A={\frac {1}{160}}}$ if ${\displaystyle d>10^{4}}$,

and

${\displaystyle B=8\cdot 10^{9}}$ if ${\displaystyle 3\leq d\leq 10^{5}}$ and ${\displaystyle B=\exp(0.03{\sqrt {d}}(\log {d})^{3})}$ if ${\displaystyle d>10^{5}}$.

### Prime number race

Although we have in particular

${\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. [25] :1–2 However Littlewood showed in 1914 [25] :2 that there are infinitely many sign changes for the function

${\displaystyle \pi _{4,1}(x)-\pi _{4,3}(x),}$

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 π(x;a,c) and π(x;b,c) change places when a and b are coprime to c. [26] Granville and Martin give a thorough exposition and survey. [25]

## Non-asymptotic bounds on the prime-counting function

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. [27]

A weaker but sometimes useful bound for x ≥ 55 is [28]

${\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: [29]

{\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}}}

The proof by de la Vallée Poussin implies the following. 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 )}}.}$

## Approximations for the nth prime number

As a consequence of the prime number theorem, one gets an asymptotic expression for the nth prime number, denoted by pn:

${\displaystyle p_{n}\sim n\log n.}$

A better approximation is [30]

${\displaystyle {\frac {p_{n}}{n}}=\log n+\log \log n-1+{\frac {\log \log n-2}{\log n}}-{\frac {(\log \log n)^{2}-6\log \log n+11}{2(\log n)^{2}}}+o\left({\frac {1}{(\log n)^{2}}}\right).}$

Again considering the 2×1017th prime number 8512677386048191063, this gives an estimate of 8512681315554715386; the first 5 digits match and relative error is about 0.00005%.

Rosser's theorem states that

${\displaystyle p_{n}>n\log n.}$

This can be improved by the following pair of bounds: [28] [31]

${\displaystyle \log n+\log \log n-1<{\frac {p_{n}}{n}}<\log n+\log \log n\quad {\text{for }}n\geq 6.}$

## Table of π(x), x / log x, and li(x)

The table compares exact values of π(x) to the two approximations x / log x and li(x). The last column, x / π(x), is the average prime gap below x.

xπ(x)π(x) − x/log xπ(x)/x / log xli(x) − π(x)x/π(x)
104−0.30.9212.22.5
102253.31.1515.14
103168231.161105.952
10412291431.132178.137
10595929061.1043810.425
1067849861161.08413012.740
107664579441581.07133915.047
10857614553327741.06175417.357
1095084753425925921.054170119.667
1010455052511207580291.048310421.975
101141180548131699231591.0431158824.283
10123760791201814167051931.0393826326.590
1013346065536839119928584521.03410897128.896
101432049417508021028383086361.03331489031.202
1015298445704226698916049624521.031105261933.507
101627923834103392578042898443931.029321463235.812
10172623557157654233688837346932811.027795658938.116
1018247399542877408606124830708935361.0252194955540.420
101923405766727634460754816241693699601.0249987777542.725
10202220819602560918840493471930446597011.02322274464445.028
1021211272694860187319284465798715781687071.02259739425447.332
102220146728668931590629040607040060196209941.021193235520849.636
10231925320391606803968923370835137665786313091.020725018621651.939
1024184355997673492008678663399963547137080490691.0191714690727854.243
102517684630939914376941168031285166378430383512281.0185516098093956.546
OEIS A006880 A057835 A057752

The value for π(1024) was originally computed assuming the Riemann hypothesis; [32] it has since been verified unconditionally. [33]

## Analogue for irreducible polynomials over a finite field

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

${\displaystyle N_{n}\sim {\frac {q^{n}}{n}}.}$

If we make the substitution x = qn, then the right hand side is just

${\displaystyle {\frac {x}{\log _{q}x}},}$

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, [34] 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

${\displaystyle q^{n}=\sum _{d\mid n}dN_{d},}$

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.

## Notes

1. Hoffman, Paul (1998). . New York: Hyperion Books. p.  227. ISBN   978-0-7868-8406-3. MR   1666054.
2. "Prime Curios!: 8512677386048191063". Prime Curios!. University of Tennessee at Martin. 2011-10-09.
3. C. F. Gauss. Werke, Bd 2, 1st ed, 444–447. Göttingen 1863.
4. Costa Pereira, N. (August–September 1985). "A Short Proof of Chebyshev's Theorem". American Mathematical Monthly. 92 (7): 494–495. doi:10.2307/2322510. JSTOR   2322510.
5. Nair, M. (February 1982). "On Chebyshev-Type Inequalities for Primes". American Mathematical Monthly. 89 (2): 126–129. doi:10.2307/2320934. JSTOR   2320934.
6. Ingham, A. E. (1990). The Distribution of Prime Numbers. Cambridge University Press. pp. 2–5. ISBN   978-0-521-39789-6.
7. Newman, Donald J. (1980). "Simple analytic proof of the prime number theorem". American Mathematical Monthly . 87 (9): 693–696. doi:10.2307/2321853. JSTOR   2321853. MR   0602825.
8. Zagier, Don (1997). "Newman's short proof of the prime number theorem". American Mathematical Monthly. 104 (8): 705–708. doi:10.2307/2975232. JSTOR   2975232. MR   1476753.
9. Tao, Terence. "254A, Notes 2: Complex-analytic multiplicative number theory". Terence Tao's blog.
10. Edwards, Harold M. (2001). Riemann's zeta function. Courier Dover Publications. ISBN   978-0-486-41740-0.
11. Kevin Ford (2002). "Vinogradov's Integral and Bounds for the Riemann Zeta Function" (PDF). Proc. London Math. Soc. 85 (3): 565–633. arXiv:. doi:10.1112/S0024611502013655. S2CID   121144007.
12. Tim Trudgian (February 2016). "Updating the error term in the prime number theorem". Ramanujan Journal. 39 (2): 225–234. arXiv:. doi:10.1007/s11139-014-9656-6. S2CID   11013503.
13. Von Koch, Helge (1901). "Sur la distribution des nombres premiers" [On the distribution of prime numbers]. Acta Mathematica (in French). 24 (1): 159–182. doi:10.1007/BF02403071. MR   1554926. S2CID   119914826.
14. Schoenfeld, Lowell (1976). "Sharper Bounds for the Chebyshev Functions θ(x) and ψ(x). II". Mathematics of Computation. 30 (134): 337–360. doi:10.2307/2005976. JSTOR   2005976. MR   0457374..
15. Jørgensen, Bent; Martínez, José Raúl; Tsao, Min (1994). "Asymptotic behaviour of the variance function". Scandinavian Journal of Statistics. 21 (3): 223–243. JSTOR   4616314. MR   1292637.
16. Littlewood, J. E. (1914). "Sur la distribution des nombres premiers". Comptes Rendus . 158: 1869–1872. JFM   45.0305.01.
17. Goldfeld, Dorian (2004). "The elementary proof of the prime number theorem: an historical perspective" (PDF). In Chudnovsky, David; Chudnovsky, Gregory; Nathanson, Melvyn (eds.). Number theory (New York, 2003). New York: Springer-Verlag. pp. 179–192. doi:10.1007/978-1-4419-9060-0_10. ISBN   978-0-387-40655-8. MR   2044518.
18. Selberg, Atle (1949). "An Elementary Proof of the Prime-Number Theorem". Annals of Mathematics . 50 (2): 305–313. doi:10.2307/1969455. JSTOR   1969455. MR   0029410.
19. Baas, Nils A.; Skau, Christian F. (2008). "The lord of the numbers, Atle Selberg. On his life and mathematics" (PDF). Bull. Amer. Math. Soc. 45 (4): 617–649. doi:. MR   2434348.
20. Cornaros, Charalambos; Dimitracopoulos, Costas (1994). "The prime number theorem and fragments of PA" (PDF). Archive for Mathematical Logic. 33 (4): 265–281. doi:10.1007/BF01270626. MR   1294272. S2CID   29171246. Archived from the original (PDF) on 2011-07-21.
21. Avigad, Jeremy; Donnelly, Kevin; Gray, David; Raff, Paul (2008). "A formally verified proof of the prime number theorem". ACM Transactions on Computational Logic . 9 (1): 2. arXiv:. doi:10.1145/1297658.1297660. MR   2371488. S2CID   7720253.
22. Harrison, John (2009). "Formalizing an analytic proof of the Prime Number Theorem". Journal of Automated Reasoning . 43 (3): 243–261. CiteSeerX  . doi:10.1007/s10817-009-9145-6. MR   2544285. S2CID   8032103.
23. Soprounov, Ivan (1998). "A short proof of the Prime Number Theorem for arithmetic progressions" (PDF).Cite journal requires |journal= (help)
24. Bennett, Michael A.; Martin, Greg; O'Bryant, Kevin; Rechnitzer, Andrew (2018). "Explicit bounds for primes in arithmetic progressions". Illinois J. Math. 62 (1–4): 427–532. arXiv:. doi:10.1215/ijm/1552442669.
25. Granville, Andrew; Martin, Greg (2006). "Prime Number Races" (PDF). American Mathematical Monthly . 113 (1): 1–33. doi:10.2307/27641834. JSTOR   27641834. MR   2202918.
26. Guy, Richard K. (2004). Unsolved problems in number theory (3rd ed.). Springer-Verlag. A4. ISBN   978-0-387-20860-2. Zbl   1058.11001.
27. Dusart, Pierre (1998). Autour de la fonction qui compte le nombre de nombres premiers (PhD thesis) (in French).
28. Rosser, Barkley (1941). "Explicit Bounds for Some Functions of Prime Numbers". American Journal of Mathematics . 63 (1): 211–232. doi:10.2307/2371291. JSTOR   2371291. MR   0003018.
29. Dusart, Pierre (2010). "Estimates of Some Functions Over Primes without R.H". arXiv: [math.NT].
30. Cesàro, Ernesto (1894). "Sur une formule empirique de M. Pervouchine". Comptes Rendus Hebdomadaires des Séances de l'Académie des Sciences (in French). 119: 848–849.
31. Dusart, Pierre (1999). "The kth prime is greater than k(log k + log log k−1) for k ≥ 2". Mathematics of Computation . 68 (225): 411–415. doi:. MR   1620223.
32. "Conditional Calculation of π(1024)". Chris K. Caldwell. Retrieved 2010-08-03.
33. Platt, David (2015). "Computing π(x) analytically". Mathematics of Computation . 84 (293): 1521–1535. arXiv:. doi:10.1090/S0025-5718-2014-02884-6. MR   3315519. S2CID   119174627.
34. Chebolu, Sunil; Mináč, Ján (December 2011). "Counting Irreducible Polynomials over Finite Fields Using the Inclusion π Exclusion Principle". Mathematics Magazine. 84 (5): 369–371. arXiv:. doi:10.4169/math.mag.84.5.369. JSTOR   10.4169/math.mag.84.5.369. S2CID   115181186.

## Related Research Articles

In mathematics, the gamma function is one commonly used extension of the factorial function to complex numbers. The gamma function is defined for all complex numbers except the non-positive integers. For any positive integer n,

The Riemann zeta function or Euler–Riemann zeta function, ζ(s), is a mathematical function of a complex variable s, and can be expressed as:

In complex analysis, a branch of mathematics, analytic continuation is a technique to extend the domain of definition of a given analytic function. Analytic continuation often succeeds in defining further values of a function, for example in a new region where an infinite series representation in terms of which it is initially defined becomes divergent.

The Liouville Lambda function, denoted by λ(n) and named after Joseph Liouville, is an important arithmetic function. Its value is +1 if n is the product of an even number of prime numbers, and −1 if it is the product of an odd number of primes.

In probability theory and statistics, the zeta distribution is a discrete probability distribution. If X is a zeta-distributed random variable with parameter s, then the probability that X takes the integer value k is given by the probability mass function

The Euler–Mascheroni constant is a mathematical constant recurring in analysis and number theory, usually denoted by the lowercase Greek letter gamma.

The Riemann hypothesis is one of the most important conjectures in mathematics. It is a statement about the zeros of the Riemann zeta function. Various geometrical and arithmetical objects can be described by so-called global L-functions, which are formally similar to the Riemann zeta-function. One can then ask the same question about the zeros of these L-functions, yielding various generalizations of the Riemann hypothesis. Many mathematicians believe these generalizations of the Riemann hypothesis to be true. The only cases of these conjectures which have been proven occur in the algebraic function field case.

In mathematics, the n-th harmonic number is the sum of the reciprocals of the first n natural numbers:

In mathematics, analytic number theory is a branch of number theory that uses methods from mathematical analysis to solve problems about the integers. It is often said to have begun with Peter Gustav Lejeune Dirichlet's 1837 introduction of Dirichlet L-functions to give the first proof of Dirichlet's theorem on arithmetic progressions. It is well known for its results on prime numbers and additive number theory.

In complex analysis, Liouville's theorem, named after Joseph Liouville, states that every bounded entire function must be constant. That is, every holomorphic function for which there exists a positive number such that for all in is constant. Equivalently, non-constant holomorphic functions on have unbounded images.

In mathematics, the prime-counting function is the function counting the number of prime numbers less than or equal to some real number x. It is denoted by π(x).

In mathematics, the Hurwitz zeta function is one of the many zeta functions. It is formally defined for complex variables s with Re(s) > 1 and a ≠ 0, −1, −2, ... by

In number theory, the Mertens function is defined for all positive integers n as

In mathematics, the von Mangoldt function is an arithmetic function named after German mathematician Hans von Mangoldt. It is an example of an important arithmetic function that is neither multiplicative nor additive.

In mathematics, the universality of zeta functions is the remarkable ability of the Riemann zeta function and other similar functions to approximate arbitrary non-vanishing holomorphic functions arbitrarily well.

In mathematics, the explicit formulae for L-functions are relations between sums over the complex number zeroes of an L-function and sums over prime powers, introduced by Riemann (1859) for the Riemann zeta function. Such explicit formulae have been applied also to questions on bounding the discriminant of an algebraic number field, and the conductor of a number field.

In mathematics, at the intersection of number theory and special functions, Apéry's constant is the sum of the reciprocals of the positive cubes. That is, it is defined as the number

In mathematics, the Chebyshev function is either of two related functions. The first Chebyshev functionϑ(x) or θ(x) is given by

In mathematics, the Riemann hypothesis is a conjecture that the Riemann zeta function has its zeros only at the negative even integers and complex numbers with real part 1/2. Many consider it to be the most important unsolved problem in pure mathematics. It is of great interest in number theory because it implies results about the distribution of prime numbers. It was proposed by Bernhard Riemann (1859), after whom it is named.

In mathematics, Ramanujan's master theorem is a technique that provides an analytic expression for the Mellin transform of an analytic function.