Prime-counting function

Of great interest in number theory is the growth rate of the prime-counting function.

The prime number theorem was first proved in 1896 by Jacques Hadamard and by Charles de la Vallée Poussin independently, using properties of the Riemann zeta function introduced by Riemann in 1859.

Proofs of the prime number theorem not using the zeta function or complex analysis were found around 1948 by Atle Selberg and by Paul Erdős (for the most part independently).

Mossinghoff and Trudgian proved[8] an explicit upper bound for the difference between π(x) and li(x):

Bernhard Riemann, in his work On the Number of Primes Less Than a Given Magnitude, proved that π0(x) is equal to[9]

μ(n) is the Möbius function, li(x) is the logarithmic integral function, ρ indexes every zero of the Riemann zeta function, and li(x⁠ρ/n⁠) is not evaluated with a branch cut but instead considered as Ei(⁠ρ/n⁠ log x) where Ei(x) is the exponential integral.

The table shows how the three functions π(x), ⁠x/log x⁠, and li(x) compared at powers of 10.

The value for π(1024) was originally computed by J. Buethe, J. Franke, A. Jost, and T. Kleinjung assuming the Riemann hypothesis.

The values for 1027, 1028, and 1029 were announced by David Baugh and Kim Walisch in 2015,[17] 2020,[18] and 2022,[19] respectively.

A simple way to find π(x), if x is not too large, is to use the sieve of Eratosthenes to produce the primes less than or equal to x and then to count them.

A more elaborate way of finding π(x) is due to Legendre (using the inclusion–exclusion principle): given x, if p1, p2,…, pn are distinct prime numbers, then the number of integers less than or equal to x which are divisible by no pi is (where ⌊x⌋ denotes the floor function).

In 1959, Derrick Henry Lehmer extended and simplified Meissel's method.

On the other hand, the computation of Φ(m,n) can be done using the following rules: Using his method and an IBM 701, Lehmer was able to compute the correct value of π(109) and missed the correct value of π(1010) by 1.

[20] Further improvements to this method were made by Lagarias, Miller, Odlyzko, Deléglise, and Rivat.

Riemann's prime-power counting function is usually denoted as Π0(x) or J0(x).

It has jumps of ⁠1/n⁠ at prime powers pn and it takes a value halfway between the two sides at the discontinuities of π(x).

That added detail is used because the function may then be defined by an inverse Mellin transform.

Formally, we may define Π0(x) by where the variable p in each sum ranges over all primes within the specified limits.

Analytic formulas for prime-counting were the first used to prove the prime number theorem.

They stem from the work of Riemann and von Mangoldt, and are generally known as explicit formulae.

[23] We have the following expression for the second Chebyshev function ψ: where Here ρ are the zeros of the Riemann zeta function in the critical strip, where the real part of ρ is between zero and one.

The formula is valid for values of x greater than one, which is the region of interest.

The sum over the roots is conditionally convergent, and should be taken in order of increasing absolute value of the imaginary part.

Note that the same sum over the trivial roots gives the last subtrahend in the formula.

The first term li(x) is the usual logarithmic integral function; the expression li(xρ) in the second term should be considered as Ei(ρ log x), where Ei is the analytic continuation of the exponential integral function from negative reals to the complex plane with branch cut along the positive reals.

The final integral is equal to the series over the trivial zeros: Thus, Möbius inversion formula gives us[10] valid for x > 1, where is Riemann's R-function[24] and μ(n) is the Möbius function.

Folkmar Bornemann proved,[27] when assuming the conjecture that all zeros of the Riemann zeta function are simple,[note 1] that where ρ runs over the non-trivial zeros of the Riemann zeta function and t > 0.

The sum over non-trivial zeta zeros in the formula for π0(x) describes the fluctuations of π0(x) while the remaining terms give the "smooth" part of prime-counting function,[28] so one can use as a good estimator of π(x) for x > 1.

In fact, since the second term approaches 0 as x → ∞, while the amplitude of the "noisy" part is heuristically about ⁠√x/log x⁠, estimating π(x) by R(x) alone is just as good, and fluctuations of the distribution of primes may be clearly represented with the function Ramanujan[29] proved that the inequality holds for all sufficiently large values of x.

[37][38][39] The Riemann hypothesis implies a much tighter bound on the error in the estimate for π(x), and hence to a more regular distribution of prime numbers, Specifically,[40] Dudek (2015) proved that the Riemann hypothesis implies that for all x ≥ 2 there is a prime p satisfying

The values of π ( n ) for the first 60 positive integers
Riemann's explicit formula using the first 200 non-trivial zeros of the zeta function
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.