Riemann-Siegel Formula

Author

Eric W. Weisstein
January 1, 2006

This notebook downloaded from http://mathworld.wolfram.com/notebooks/NumberTheory/Riemann-SiegelFormula.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/Riemann-SiegelFormula.html.

©2005 Wolfram Research, Inc. except for portions noted otherwise

Plots

f[x_]:=((PrimePi[x]-(LogIntegral[x]-LogIntegral[2]))/((Sqrt[x])/(Log[x])))

Plot[f[x],{x,0,100},PlotStyle->Red]

zeros=ReadList["/Volumes/Data/Math/ZetaZeros.txt"];//Timing

g[x_,n_:All]:=-1-2Plus@@(Sin[# Log[x]]/#&/@Take[zeros,n])

Plot[f[x]-g[x,50],{x,0,500},PlotStyle->Red]

ListPlot[Table[{x,f[x]-g[x,50]},{x,2,10^6,1000}],PlotJoined->True,PlotStyle->Red]//Timing

Riemann Integral

v5.2

i=Integrate[((Exp[I (u^2)/(4π)]Exp[2p u])/((E^u)-1)),{u,(I+1)t+I Pi,-(I+1)t+I Pi}]

i/.t->1

v6

(i=Integrate[((Exp[I (u^2)/(4π)]Exp[2p u])/((E^u)-1)),{u,(I+1)t+I Pi,-(I+1)t+I Pi}])//Timing

i/.t->1//Timing

Random

Subtract@@With[{t=100,p=1.234},
{
Exp[I π/8]Exp[-2π I (p^2)](1/(2π I))NIntegrate[((Exp[I (u^2)/(4π)]Exp[2p u])/((E^u)-1)),{u,(I+1)t+I Pi,-(I+1)t+I Pi}],
((Cos[2π((p^2)-p-(1/16))])/(Cos[2π p]))
}
]//Chop

Expansion

Z(t)(Underscript[=, t->∞])2(∑_(k=1)^(ν(t)))(1/(Sqrt[k]))cos(ϑ(t)-t log(k))+R(t)
ν(t)=⌊(Sqrt[(t/(2π))])⌋

R(t)=(((-1))^(ν(t)-1))((((t/(2π))))^(-(1/4)))(∑_(k=0)^∞)(Subscript[c, k])((Sqrt[(t/(2π))])-ν(t))((((t/(2π))))^(-(k/2)))

(Subscript[c, k])(p)=[(ω^k)](exp(i(log((t/(2 π)))-(t/2)-(π/8)-ϑ(t)))×[(y^0)](((∑_(j=0)^∞)(Subscript[A, j])(y) (ω^j))((∑_(j=0)^∞)((Derivative[j][ψ](p))/(j!)) (y^j))))

(Subscript[A, j])(y)=-(1/2) y (Subscript[A, j-1])(y)-(1/(32 (π^2)))((∂^2)/(∂(y^2)))(((Subscript[A, j-1])(y))/y);
(Subscript[A, 0])(y)=(e^(2 π i (y^2)))

ψ(p)=((cos(2π((p^2)-p-1/16)))/(cos(2π p)))

(Subscript[c, 0])(p)(Subscript[…c, 9])(p)

R[t] = ((-1)^(ν[t] - 1)*
    Sum[Subscript[c, k][Sqrt[t/(2*Pi)] - ν[t]]/
      (t/(2*Pi))^(k/2), {k, 0, Infinity}])/(t/(2*Pi))^(1/4)

ψ[p_]:=Cos[2*Pi[p^2-p-1/16]]/Cos[2*Pi*p];
A[0,y_]:=Exp[2 π i (y^2)]
A[j_,y_]:=A[j,y]=-(1/2)*y A[j - 1, y] - 1/(32*Pi^2)*D[A[j-1,y]/y, {y, 2}]

c[k_,p_]:=Coefficient[Exp[I[Log[t/(2*Pi)]-t/2-Pi/8-RiemannSiegelTheta[t]]]*SeriesCoefficient[Series[A[j,y]SeriesCoefficient[Derivative[j][ψ][p]/j!*y^j,{j,0,10}],y,0],ω,k]

l=Select[Flatten[CoefficientList[#,ψ]&/@({ψ[p],-((Derivative[3][ψ][p])/(96 (π^2))),((ψ''[p])/(64 (π^2)))+((Derivative[6][ψ][p])/(18432 (π^4))),-((ψ'[p])/(64 (π^2)))-((Derivative[5][ψ][p])/(3840 (π^4)))-((Derivative[9][ψ][p])/(5308416 (π^6))),((ψ[p])/(128 (π^2)))+((19 Derivative[4][ψ][p])/(24576 (π^4)))+((11 Derivative[8][ψ][p])/(5898240 (π^6)))+((Derivative[12][ψ][p])/(2038431744 (π^8))),-((5 Derivative[3][ψ][p])/(3072 (π^4)))-((901 Derivative[7][ψ][p])/(82575360 (π^6)))-((7 Derivative[11][ψ][p])/(849346560 (π^8)))-((Derivative[15][ψ][p])/(978447237120 (π^10))),((5 ψ''[p])/(2048 (π^4)))+((367 Derivative[6][ψ][p])/(7864320 (π^6)))+((18889 Derivative[10][ψ][p])/(237817036800 (π^8)))+((17 Derivative[14][ψ][p])/(652298158080 (π^10)))+((Derivative[18][ψ][p])/(563585608581120 (π^12))),-((5 ψ'[p])/(2048 (π^4)))-((407 Derivative[5][ψ][p])/(2621440 (π^6)))-((6649 Derivative[9][ψ][p])/(11890851840 (π^8)))-((2131 Derivative[13][ψ][p])/(5707608883200 (π^10)))-((Derivative[17][ψ][p])/(15655155793920 (π^12)))-((Derivative[21][ψ][p])/(378729528966512640 (π^14))),((41 ψ[p])/(32768 (π^4)))+((427 Derivative[4][ψ][p])/(1048576 (π^6)))+((26405 Derivative[8][ψ][p])/(8455716864 (π^8)))+((88651 Derivative[12][ψ][p])/(22830435532800 (π^10)))+((11153 Derivative[16][ψ][p])/(8766887244595200 (π^12)))+((23 Derivative[20][ψ][p])/(180347394745958400 (π^14)))+((Derivative[24][ψ][p])/(290864278246281707520 (π^16))),-((2603 Derivative[3][ψ][p])/(3145728 (π^6)))-((3781 Derivative[7][ψ][p])/(264241152 (π^8)))-((21543701 Derivative[11][ψ][p])/(669692775628800 (π^10)))-((66727 Derivative[15][ψ][p])/(3652869685248000 (π^12)))-((8503 Derivative[19][ψ][p])/(2524863526443417600 (π^14)))-((13 Derivative[23][ψ][p])/(60596724634642022400 (π^16)))-((Derivative[27][ψ][p])/(251306736404787395297280 (π^18)))}/.Derivative[n_][ψ][p_]:>ψ^n /. ψ[p_]->ψ)],#=!=0&]