Riemann Prime Counting Function

DOWNLOAD Mathematica Notebook Contribute to this entry RiemannPrimeCountingFunction

Riemann defined the function f(x) by

f(x)=sum_(p^(nu)<x; p prime)1/nu
(1)
=sum_(n)(pi(x^(1/n)))/n
(2)
=sum_(n=1)^(|_lgx_|)(pi(x^(1/n)))/n
(3)
=pi(x)+1/2pi(x^(1/2))+1/3pi(x^(1/3))+...
(4)

(Hardy 1999, p. 30; Borwein et al. 2000; Havil 2003, pp. 189-191 and 196-197; Derbyshire 2004, p. 299), sometimes denoted pi^*(x), J(x) (Edwards 2001, pp. 22 and 33; Derbyshire 2004, p. 298), or Pi(x) (Havil 2003, p. 189). Note that this is not an infinite series since the terms become zero (Derbyshire 2004, p. 299) starting at the nth term, where n=|_lgx_| and |_x_| is the floor function. For x=1, 2, ..., the first few values are 0, 1, 2, 5/2, 7/2, 7/2, 9/2, 29/6, 16/3, 16/3, ... (OEIS A096624 and A096625). As can be seen, when x is a prime, f(x) jumps by 1; when it is the square of a prime, it jumps by 1/2; when it is a cube of a prime, it jumps by 1/3; and so on (Derbyshire 2004, pp. 300-301), as illustrated above.

Amazingly, the prime counting function pi(x) is related to f(x) by the Möbius transform

 pi(x)=sum_(n=1)^infty(mu(n))/nf(x^(1/n)),
(5)

where mu(n) is the Möbius function (Riesel 1994, p. 49; Havil 2003, p. 196; Derbyshire 2004, p. 302). More amazingly still, f(x) is connected with the Riemann zeta function zeta(s) by

 (ln[zeta(s)])/s=int_0^inftyf(x)x^(-s-1)dx
(6)

(Riesel 1994, p. 47; Edwards 2001, p. 23; Derbyshire 2004, p. 309). f(x) is also given by

 f(x)=lim_(t->infty)1/(2pii)int_(2-iT)^(2+iT)(x^s)/slnzeta(s)ds,
(7)

where zeta(z) is the Riemann zeta function, and (6) and (7) form a Mellin transform pair.

RiemannFunctionF

Riemann (1859) proposed that

 f(x)=li(x)-sum_(rho)li(x^rho)-ln2+int_x^infty(dt)/(t(t^2-1)lnt),
(8)

where li(x) is the logarithmic integral and the sum is over all nontrivial zeros rho of the Riemann zeta function zeta(z) (Mathews 1961, Ch. 10; Landau 1974, Ch. 19; Ingham 1990, Ch. 4; Hardy 1999, p. 40; Borwein et al. 2000; Edwards 2001, pp. 33-34; Havil 2003, p. 196; Derbyshire 2004, p. 328). Actually, since the sum of roots is only conditionally convergent, it must be summed in order of increasing I[rho] even when pairing terms rho with their "twins" 1-rho, so

 sum_(rho)li(x^rho)=sum_(I[rho]>0)[Li(x^rho)+Li(x^(1-rho))]
(9)

(Edwards 2001, pp. 30 and 33).

This formula was subsequently proved by Mangoldt (1895; Riesel 1994, p. 47; Edwards 2001, pp. 48 and 62-65). The integral on the right-hand side converges only for x>1, but since there are no primes less than 2, the only values of interest are for x>=2. Since it is monotonic decreasing, the maximum therefore occurs at x=2, which has value

 int_2^infty(dt)/(tlnt(t^2-1))=0.14001010114328692668...
(10)

(OEIS A096623; Derbyshire 2004, p. 329).

RiemannR

Riemann also considered the function

 R(x)=sum_(n=1)^infty(mu(n))/nli(x^(1/n)),
(11)

sometimes also denoted Ri(x) (Borwein et al. 2000), obtained by replacing f(x^(1/n)) in the Riemann function with the logarithmic integral li(x^(1/n)), where zeta(z) is the Riemann zeta function and mu(n) is the Möbius function (Hardy 1999, pp. 16 and 23; Borwein et al. 2000; Havil 2003, p. 198). R(x) is plotted above, including on a semilogarithmic scale (bottom two plots), which illustrate the fact that R(x) has a series of zeros near the origin. These occur at 10^(-x) for x=14827.7 (OEIS A143530), 15300.7, 21381.5, 25461.7, 32711.9, 40219.6, 50689.8, 62979.8, 78890.2, 98357.8, ..., corresponding to x=1.829×10^(-14828) (OEIS A143531), 2.040×10^(-15301), 3.289×10^(-21382), 2.001×10^(-25462), 1.374×10^(-32712), 2.378×10^(-40220), 1.420×10^(-50690), 1.619×10^(-62980), 6.835×10^(-78891), 1.588×10^(-98358), ....

RiemannPrimeNumberFormula

The quantity R(x)-pi(x) is plotted above.

This function is implemented in the Wolfram Language as RiemannR[x].

Ramanujan independently derived the formula for R(n), but nonrigorously (Berndt 1994, p. 123; Hardy 1999, p. 23). The following table compares pi(10^n) and R(10^n) for small n. Riemann conjectured that R(n)=pi(n) (Knuth 1998, p. 382), but this was disproved by Littlewood in 1914 (Hardy and Littlewood 1918).

GramSeriesRiemannComparison

The Riemann prime counting function is identical to the Gram series

 G(x)=1+sum_(k=1)^infty((lnx)^k)/(kk!zeta(k+1)),
(12)

where zeta(z) is the Riemann zeta function (Hardy 1999, pp. 24-25), but the Gram series is much more tractable for numeric computations. For example, the plots above show the difference G(x)-R(x) where R(x) is computed using the Wolfram Language's built-in NSum command (black) and approximated using the first 10^1 (blue), 10^2 (green), 10^3 (yellow), 10^4 (orange), and 10^5 (red) points.

In the table, [x] denotes the nearest integer function. Note that the values given by Hardy (1999, p. 26) for x=10^9 are incorrect.

nnint(R(10^n))nint(R(10^n)-pi(10^n))
SloaneA057793A057794
151
2261
31680
41227-2
59587-5
67852729
766466788
8576155297
950847455-79
10455050683-1828
114118052495-2318
1237607910542-1476

Riemann's function is related to the prime counting function by

 pi(x)=R(x)-sum_(rho)R(x^rho),
(13)

where the sum is over all complex (nontrivial) zeros rho of zeta(s) (Ribenboim 1996), i.e., those in the critical strip so 0<R[rho]<1, interpreted to mean

 sum_(rho)R(x^rho)=lim_(t->infty)sum_(|I(rho)|<t)R(x^rho).
(14)

However, no proof of the equality of (13) appears to exist in the literature (Borwein et al. 2000).

Wolfram Web Resources

Mathematica »

The #1 tool for creating Demonstrations and anything technical.

Wolfram|Alpha »

Explore anything with the first computational knowledge engine.

Wolfram Demonstrations Project »

Explore thousands of free applications across science, mathematics, engineering, technology, business, art, finance, social sciences, and more.

Computerbasedmath.org »

Join the initiative for modernizing math education.

Online Integral Calculator »

Solve integrals with Wolfram|Alpha.

Step-by-step Solutions »

Walk through homework problems step-by-step from beginning to end. Hints help you try the next step on your own.

Wolfram Problem Generator »

Unlimited random practice problems and answers with built-in Step-by-step solutions. Practice online or make a printable study sheet.

Wolfram Education Portal »

Collection of teaching and learning tools built by Wolfram education experts: dynamic textbook, lesson plans, widgets, interactive Demonstrations, and more.

Wolfram Language »

Knowledge-based programming for everyone.