Function Repository Resource:

ChebyshevPsi

Source Notebook

Calculate the value of the second Chebyshev function ψ(x)

Contributed by: Jack Heimrath

ResourceFunction["ChebyshevPsi"][x]

returns the value of the second Chebyshev function at x.

Details and Options

The second Chebysev function ψ(x) is calculated by summing the MangoldtLambda function from 2 to the greatest integer less than or equal to x. If x<2, the defining sum is empty and we set ψ(x)=0 by convention.
The Prime Number Theorem is equivalent to the statement that as x.

Examples

Basic Examples (5) 

Compute ψ(30):

In[1]:=
ResourceFunction["ChebyshevPsi"][30]
Out[1]=

Obtain a decimal approximation:

In[2]:=
ResourceFunction["ChebyshevPsi"][30] // N
Out[2]=

Plot ψ(x) from 0 to 30:

In[3]:=
Plot[ResourceFunction["ChebyshevPsi"][x], {x, 0, 30}]
Out[3]=

Compare x, ψ(x), and |x-ψ(x)|:

In[4]:=
Plot[{x, ResourceFunction["ChebyshevPsi"][x], Abs[x - ResourceFunction["ChebyshevPsi"][x]]}, {x, 0, 30}, PlotLegends -> {"x", "\[Psi](x)", "|x-\[Psi](x)|"}]
Out[4]=

Plot the ratio :

In[5]:=
Plot[ResourceFunction["ChebyshevPsi"][x]/x, {x, 0, 100}]
Out[5]=

Publisher

Jack Heimrath

Version History

  • 1.0.0 – 28 June 2019

Related Resources

License Information