Explicit Formula

Author

Eric W. Weisstein
July 29, 2008

This notebook downloaded from http://mathworld.wolfram.com/notebooks/PrimeNumbers/ExplicitFormula.nb.

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

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

Identity

ChebyshevPsi(x)==-(∑_(k=-∞)^∞)Piecewise[(({{0, k==0}, {((x^(Subscript[ρ, k]))/(Subscript[ρ, k])), True}}))]-(1/2) ln(1-(1/(x^2)))-ln(2 π)+x/;x∈ℝ∧x>1∧¬x∈ℙ∧¬PrimePowerQ[x]∧PrimePowerQ[x]==((Subscript[∃, {p,k}])(p∈ℙ∧k∈ℤ∧k>0∧(p^k)==x))

ChebyshevPsi[x]==x-Sum[Piecewise[{{0,k==0},{x^ZetaZero[k]/ZetaZero[k],True}}],{k,-Infinity,Infinity}]-Log[2*Pi]-(1/2)*Log[1-1/x^2]/;Element[x,Reals]&&x>1&&!Element[x,Primes]&&!PrimePowerQ[x]&&PrimePowerQ[x]==(Exists[{p,k},Element[p,Primes]&&Element[k,Integers]&&k>0&&p^k==x])

PrimePower[1]=2;
PrimePower[n_]:=PrimePower[n]=With[{μ=PrimePower[n-1]},Select[Sort[Flatten[(Table[#1^j,{j,1,Ceiling[Log[#1,μ+1]+1]}]&)/@Table[Prime[k],{k,PrimePi[μ]+1}]]],#1>μ&,1][[1]]]

Check

ChebyshevPsi[x_]:=Log[LCM@@Range[x]]

N[With[{x=Random[]+40},{ChebyshevPsi[x],x-Sum[Piecewise[{{0,k==0},{x^ZetaZero[k]/ZetaZero[k],True}}],{k,-500,500}]-Log[2*Pi]-(1/2)*Log[1-1/x^2]}]]//Chop