The Riemann prime counting function approximates the prime
counting function (Knuth 1998, p. 382). For real
numbers
, the auxiliary function
associated with Riemann's formula (Riemann 1859) is defined
in the right-continuous convention by
|
(1)
| |||
|
(2)
| |||
|
(3)
|
(Hardy 1999, p. 30; Borwein et al. 2000; Havil 2003, pp. 189-191 and 196-197; Derbyshire 2004, p. 299), sometimes denoted ,
(Edwards 2001, pp. 22 and 33; Derbyshire 2004, p. 298),
or
(Havil 2003, p. 189). Here
is a prime and
and
are positive integers.
The terms become zero for
, where
is the floor function
and
is the base-2 logarithm. For
, 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
is a prime,
jumps by 1; when it is the square
number 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. Riemann's midpoint convention instead
uses
for
(Riemann 1859). Thus
away from prime powers.
For ,
the prime counting function
is related to
by Möbius inversion
|
(4)
|
where
is the Möbius function (Riesel 1994, p. 49;
Havil 2003, p. 196; Derbyshire 2004, p. 302). Extending
by 0 for
, its connection with the Riemann
zeta function is
|
(5)
|
for ,
with the analytic branch of
tending to 0 as
(Riesel 1994, p. 47; Edwards 2001, p. 23;
Derbyshire 2004, p. 309). Its inverse for real
is
|
(6)
|
The transform identity and its inverse form a Mellin transform pair.
Riemann (1859) proposed that
|
(7)
|
for real ,
where
is the logarithmic integral and the sum is
over all nontrivial zeros
of the Riemann zeta
function
(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). Zeros
are counted with multiplicity, and the sum is interpreted as the limit of sums with
as
.
Here
means
,
where
is the exponential integral. Pairing
with
gives
|
(8)
|
with pairs ordered by increasing positive (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 , but since there are no primes
less than 2, the only values of interest are for
. Since it is monotonic decreasing, the maximum therefore
occurs at
, which has value
|
(9)
|
(OEIS A096623; Derbyshire 2004, p. 329).
For ,
Riemann (1859) also considered the function
|
(10)
|
sometimes also denoted (Borwein et al. 2000), obtained by replacing
in the Möbius inversion formula with the
logarithmic integral
, where
is the Möbius function
(Hardy 1999, pp. 16 and 23; Borwein et al. 2000; Havil 2003, p. 198).
The Gram series defines its continuation to
, with
.
is plotted above, including on a semilogarithmic scale
(bottom two plots), which illustrate the fact that
has a series of zeros near the origin. These occur at
for
(OEIS A143530), 15300.7, 21381.5, 25461.7,
32711.9, 40219.6, 50689.8, 62979.8, 78890.2, 98357.8, ..., corresponding to
(OEIS A143531),
,
,
,
,
,
,
,
,
, ....
The quantity is plotted above.
This function is implemented in the Wolfram Language as RiemannR[x].
Ramanujan independently derived the formula for , but nonrigorously (Berndt 1994, p. 123; Hardy 1999,
p. 23). The following table compares
and
for small
. Littlewood proved in 1914 that
changes sign infinitely often (Hardy and Littlewood
1918).
For real ,
the Riemann prime counting function is given by the Gram
series
|
(11)
|
where
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
where
is computed using the Wolfram Language's
built-in NSum command (black) and approximated using the first
(blue),
(green),
(yellow),
(orange), and
(red) points.
In the table, denotes the nearest
integer function. Note that the values given by Hardy (1999, p. 26) for
are incorrect.
| Sloane | A057793 | A057794 |
| 1 | 5 | 1 |
| 2 | 26 | 1 |
| 3 | 168 | 0 |
| 4 | 1227 | |
| 5 | 9587 | |
| 6 | 78527 | 29 |
| 7 | 664667 | 88 |
| 8 | 5761552 | 97 |
| 9 | 50847455 | |
| 10 | 455050683 | |
| 11 | 4118052495 | |
| 12 | 37607910542 |
Borwein et al. (2000, p. 249) discuss the approximation for real
|
(12)
|
where the sum is over all nontrivial zeros of
, counted with multiplicity, and interpreted to mean
|
(13)
|
In this sum, is evaluated by the Gram
series with
interpreted as
. Borwein et al. (2000, p. 249) report that
the relation had been called exact (Ribenboim 1996), but they could not locate a
proof of that equality.