Prime counting function

From Free net encyclopedia

(Difference between revisions)

Current revision

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 <math>\pi(x)</math> (although it has no connection with the number π).

Image:PrimePi.PNG

Contents

History

Of great interest in number theory is the growth rate of the prime counting function. It was conjectured in the end of the 18th century by Gauss and by Legendre to be approximately

<math> x/\operatorname{ln}(x),\,</math>

in the sense that

<math>\lim_{x\rightarrow +\infty}\frac{\pi(x)}{x/\operatorname{ln}(x)}=1.\,</math>

This statement is the prime number theorem. An equivalent statement is

<math>\lim_{x\rightarrow +\infty}\pi(x) / \operatorname{li}(x)=1,\,</math>

where li is the logarithmic integral function. This was first proved around 1896 by Hadamard and by de la Vallée Poussin (independently), using properties of the Riemann zeta function introduced by Riemann in 1859.

More precise estimates of <math>\pi(x)</math> are now known; for example

<math>\pi(x) = \operatorname{li}(x) + O \left( x \exp \left( -\frac{\sqrt{\ln(x)}}{15} \right) \right),</math>

where the O is big O notation. 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).

Algorithms for evaluating π(x)

A simple way to find <math>\pi(x)</math>, if <math>x</math> isn't too large, is to use the sieve of Eratosthenes to produce the primes smaller or equal to <math>x</math> and then to count them.

A more elaborate way of finding <math>\pi(x)</math> is due to Legendre: given <math>x</math>, if <math>p_1</math>, <math>p_2</math>, …, <math>p_k</math> are distinct prime numbers, then the number of integers smaller or equal to <math>x</math> which are divisible by no <math>p_i</math> is

<math>\lfloor x\rfloor - \sum_{i}\left\lfloor\frac{x}{p_i}\right\rfloor + \sum_{i<j}\left\lfloor\frac{x}{p_ip_j}\right\rfloor - \sum_{i<j<k}\left\lfloor\frac{x}{p_ip_jp_k}\right\rfloor + \cdots,</math>

(where <math>\lfloor\cdot\rfloor</math> denotes the floor function). This number is therefore equal to

<math>\pi(x)-\pi\left(\sqrt{x}\right)+1\,</math>

when the numbers <math>p_1</math>, <math>p_2</math>, …, <math>p_k</math> are the prime numbers smaller or equal to the square root of <math>x</math>.

In a series of articles published between 1870 and 1885, Ernst Meissel described (and used) a practical combinatorial way of evaluating <math>\pi(x)</math>. Let <math>p_1</math>, <math>p_2</math>, …, <math>p_n</math> be the first <math>n</math> primes and denote by <math>\Phi(m,n)</math> the number of natural numbers not greater than <math>m</math> which are divisible by no <math>p_i</math>. Then

<math>\Phi(m,n)=\Phi(m,n-1)-\Phi\left(\left[\frac{m}{p_n}\right],n-1\right),\,</math>

Given a natural number <math>m</math>, if <math>n=\pi\left(\sqrt[3]{m}\right)</math> and if <math>\mu=\pi\left(\sqrt{m}\right)-n</math>, then

<math>\pi(m)=\Phi(m,n)+n(\mu+1)+\frac{\mu^2-\mu}{2}-1-\sum_{k=1}^\mu\pi\left(\frac{m}{p_{n+k}}\right).\,</math>

Using this approach, Meissel computed <math>\pi(x)</math>, for <math>x</math> equal to 5×105, 106, 107, and 108.

In 1959, Derrick Henry Lehmer extended and simplified Meissel's method. Define, for real <math>m</math> and for natural numbers <math>n</math>, and <math>k</math>, <math>P_k(m,n)</math> as the number of numbers not greater than m with exactly k prime factors, all greater than <math>p_n</math>. Furthermore, set <math>P_0(m,n)=1</math>. Then

<math>\Phi(m,n)=\sum_{k=0}^{+\infty}P_k(m,n),\,</math>

where the sum actually has only finitely many nonzero terms. Let <math>y</math> denote an integer such that <math>\sqrt[3]{m}\le y\le\sqrt{m}</math>, and set <math>n=\pi(y)</math>. Then <math>P_1(m,n)=\pi(m)-n</math> and <math>P_k(m,n)=0</math> when <math>k</math> ≥ 3. Therefore

<math>\pi(m)=\Phi(m,n)+n-1-P_2(m,n).</math>

The computation of <math>P_2(m,n)</math> can be obtained this way:

<math>P_2(m,n)=\sum_{y<p\le\sqrt{m}}\left(\pi\left(\frac mp\right)-\pi(p)+1\right).\,</math>

On the other hand, the computation of <math>\Phi(m,n)</math> can be done using the following rules:

  1. <math>\Phi(m,0)=\lfloor m\rfloor;\,</math>
  2. <math>\Phi(m,b)=\Phi(m,b-1)-\Phi\left(\frac m{p_b},b-1\right).\,</math>

Using his method and an IBM 701, Lehmer was able to compute <math>\pi\left(10^{10}\right)</math>.

Other prime counting functions

Other prime counting functions are also used because they are more convenient to work with. One is Riemann's prime counting function, denoted <math>\Pi(x)</math> or <math>J(x)</math>. This has jumps of 1/n for prime powers pn, with it taking a value half-way between the two sides at discontinuities. That added detail is because then it may be defined by an inverse Mellin transform. Formally, we may define J by

<math>J(x) = \frac12 \bigg(\sum_{p^n < x} \frac1n\ + \sum_{p^n \le x} \frac1n\bigg)</math>

where p is a prime.

We may also write

<math>J(x) = \sum_{n=1}^\infty \frac1n \pi(x^{1/n})</math>

except where we have discontinuities at prime powers, and hence π can be recovered from J by Möbius inversion.

Chebyshev's prime counting functions weight primes or prime powers pn by ln p:

<math>\theta(x)=\sum_{p\le x}\ln p,</math>
<math>\psi(x) = \frac12 \bigg(\sum_{p^n < x} \ln p\ + \sum_{p^n \le x} \ln p\bigg).</math>

Apart from the discontinuities at prime powers, we have

<math>\psi(x)=\sum_{n=1}^\infty\theta(x^{1/n})=\sum_{n\le x}\Lambda(n),</math>

where Λ(n) is the von Mangoldt function.

Formulas for prime counting functions

These come in two kinds, arithmetic formulas and analytic formulas. The latter are what allow us to prove the prime number theorem. They stem from the work of Riemann and von Mangoldt, and are generally known as explicit formulas.

We have the following expression for ψ:

<math>\psi(x) = x - \sum_\rho \frac{x^\rho}{\rho} - \ln 2\pi - \frac12 \ln(1-x^{-2}).</math>

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, and the sum over the roots is conditionally convergent, and should be taken in order of increasing absolute value of the imaginary part.

For J we have a more complicated formula

<math>J(x) = \operatorname{li}(x) - \sum_{\rho}\operatorname{li}(x^{\rho}) - \ln 2 + \int_x^\infty \frac{dt}{t(t^2-1) \ln t}.</math>

Again, the formula is valid for x > 1, and ρ are the nontrivial zeros of the zeta function ordered according to their absolute value. The first term li(x) is the usual logarithmic integral; however, it is not easily describable what li means in the other terms. The best way to think about it is to consider the expression <math>\operatorname{li}(x^\rho)</math> as an abbreviation for <math>\operatorname{Ei}(\rho\ln x)</math>, where Ei is the analytic continuation of the exponential integral function from positive reals to the complex plane with branch cut along the negative reals.

Inequalities

Here are some useful inequalities for π(x).

<math>

\pi(x) > \frac {x} {\log x} </math> for x ≥ 17.

<math>

\pi(x) < 1.25506 \frac {x} {\log x} </math> for x > 1.

<math>

\frac {x} {\log x + 2} < \pi(x) < \frac {x} {\log x - 4} </math> for x ≥ 55.

Here are some inequalities for the nth prime, pn.

<math>

n\ \ln n + n\ln\ln n - n < p_n < n \ln n + n \ln \ln n </math> for n ≥ 6. The left inequality holds for n ≥ 1 and the right inequality holds for n ≥ 6.

An approximation for the nth prime number is

<math> p_n = n \ln n + n \ln \ln n - n + \frac {n \ln \ln n - 2n} {\ln n} +

O\left( \frac {n (\ln \ln n)^2} {(\ln n)^2}\right). </math>

The Riemann hypothesis

The Riemann hypothesis is equivalent to a much sharper bound on the error in the estimate for <math>\pi(x)</math>, and hence to a more regular distribution of prime numbers,

<math>\pi(x) = \operatorname{li}(x) + O(\sqrt{x} \log{x}).</math>

References

  • Eric Bach and Jeffrey Shallit, Algorithmic Number Theory, volume 1, 1996, MIT Press. ISBN 0-262-02405-5, see page 234 in section 8.8.

it:Funzione enumerativa dei primi pl:Funkcja π sl:Število praštevil