Study of the prime counting function π (x)
In[]:=
ComplexPlot3D[Zeta[s],{s,-8-25I,8+25I},PlotLegends->True]
Out[]=
Zeta Riemann function Zeta[s] found in Mathematica is the analytical continuation of the serie
∞
∑
n=1
1
s
n
(defined for s complex Re(s)>1 to all the complex plane -{1}.As a hobby I studied the prime counting function of Riemann π(x) which gives the number of prime numbers found between 0 and x (Source : https://fr.wikipedia.org/wiki/Fonction_R_de_Riemann):
R (x) is in Mathematica RiemannR[x].​For
x>0
, the Riemann prime counting function is given by
R(x)
∞
∑
n
μ(n)li(
1/n
x
)/n
. ​R (x) is an approximation of PrimePi[x] which gives the exact number of primes until x.
In[]:=
RiemannR[1000]//N
Out[]=
168.359
In[]:=
PrimePi[1000]
Out[]=
168
∑
ρ
R(
ρ
x
)
is the correction of R(x) using the zeros ZetaZero[i] of the Zeta Riemann functionπ(x) = R(x) -
∑
ρ
R(
ρ
x
)
should be equal (or very close to) to PrimePi[x] as we increase the number of zeros used in this formula.​​My idea was simply to compute this formula of π(x) to check if it works in Matematica.
Here is the first zeros of Zeta:
In[]:=
For[i=0,i<5,Print[N[ZetaZero[i]]," ",N[Conjugate[ZetaZero[i]]]],i++]
0.5+14.1347 0.5-14.1347
0.5+21.022 0.5-21.022
0.5+25.0109 0.5-25.0109
0.5+30.4249 0.5-30.4249
0.5+32.9351 0.5-32.9351
And heres is the computation of π(1000) which should give 168:
x=1000;​​p=RiemannR[x];​​For[i=0,i<10,p=p-RiemannR[
ZetaZero[i]
x
]-RiemannR[
Conjugate[ZetaZero[i]]
x
],i++]​​N[p]
Out[]=
138.404+0.
138.404 is very different from 168. The formula doesn’t seem to work.
If I do the correcting sum on more zeros of Zeta (100 instead of 10) it should give an approximation closer to PrimePi[x] but it is even worse (I get a negative number!) :
In[]:=
x=1000;​​p=RiemannR[x];​​For[i=0,i<100,p=p-RiemannR[
ZetaZero[i]
x
]-RiemannR[
Conjugate[ZetaZero[i]]
x
],i++]​​N[p]
Out[]=
-571.8+0.
I don' t understand why it doesn' t work .
Can you help me?