# explicit formula for Riemann zeros counting function

I've often seen it stated (in vague terms) that there's a Fourier duality between the set of prime numbers and the set of nontrivial Riemann zeta zeros.

Because there are various explicit formulae whereby prime counting functions can be expressed as infinite sums of sinusoidal functions over the set of zeta zeros, I had always assumed that the same thing would work in the opposite direction. That is, I imagined there was a well-known formula whereby the nontrivial-zeta-zeros-counting function could be expressed as an infinite sum of sinusoidal functions over the set of primes.

However, I've been unable to find such a formula. The only explicit formula I've found for this counting function looks like this:

$f(E) = \frac{1}{\pi} \Im(\ln(\Gamma(1/4 + iE/2)) - \frac{E}{2\pi}\ln(\pi) + \frac{1}{\pi} \Im(\ln(\zeta(1/2 + iE)) + 1$

where there's no explicit involvement of the primes.

Is anyone aware of a formula of the type I'm seeking? I'm quite sure such a thing must exist, since a programmer friend recently looked at this and got curious enough to "illegally" substitute the (truncated) Euler product expression for zeta in the above (it doesn't converge in the critical strip, hence such a substitution is not mathematically valid), just to see what the resulting function would look like. His plots of

$N_m(E) = \frac{1}{\pi} \Im(\ln(\Gamma(1/4 + iE/2)) - \frac{E}{2\pi}\ln(\pi) - \frac{1}{\pi} \sum_{p < m} \Im(\ln(1-p^{-1/2-iE})) + 1$

in three colours [corresponding to m= 100, 1000 and 10000 and where E varies over (4,60)] can be seen here:

http://img593.imageshack.us/img593/9048/nmfunction.gif

The positions of the zeta zeros are clearly visible, so even though this isn't a valid formula, I imagine that there must be something like this which is valid.

-
You might want to change $p$ in the second formula to the more customary $\rho$. At first glance, I assumed you were summing over primes less than $m$. –  Barry Cipra Dec 4 '11 at 17:59
@Barry, I think OP is summing over primes. I think the whole point of the question is whether there is a formula for the number of zeros as a sum over primes. –  Gerry Myerson Dec 4 '11 at 22:12
Gerry, you're quite right. –  Barry Cipra Dec 4 '11 at 23:54

It looks like the exact formula being sought here can be found in A.P. Guinand, "A summation formula in the theory of prime numbers", Proceedings of the London Mathematical Society (2) 50 (1948) 107--119. The first page is visible here without subscription:

You can see the explicit formula in the abstract, although hard to see the fine detail without access to the full PDF. This is a general form involving a function $f$ and an integral transform thereof. The abstract mentions "appropriate conditions" on $f$: I can't see what these are, but with an appropriate choice of this function, the formula displayed would presumably reduce to a fairly straightforward relation between a sum over the primes and a sum over the nontrivial zeros.

-
@Matthew: I took the liberty of adding an image of the formula. –  Joseph O'Rourke Dec 10 '11 at 15:55

Assuming the Riemann Hypothesis, you can use a smooth approximation to the characteristic function of an interval in the Guinand-Weil explicit formula to approximately count the number of zeros of the zeta-function in an interval on the critical line. This expresses the approximate number of such zeros in terms of an integral of your test function and a sum over primes, as you seek. In fact, this can be set-up in such a way that the sum over primes is finite. (This method can be used to give upper and lower bounds for the number of zeros, but not an exact formula.)

The details are (essentially) contained in a paper by Goldston & Gonek "A note on S(t) and the zeros of the Riemann zeta function" available on Dan Goldston's webpage: math.sjsu.edu/~goldston/publications.htm

-

The formula is given by Guinand as said in his answer by Matthew Watkins but it can be found in page 111 of the paper and reads: assuming Riemann Hypothesis and $T>0$ $$\frac12(N(T+0)+N(T-0))=\frac{T}{2\pi}\log\frac{T}{2\pi}-\frac{T}{2\pi}-$$ $$- \frac{1}{\pi}\lim_{N\to\infty}\Bigl[\sum_{n=1}^N\Lambda(n)\frac{\sin(T\log n)}{n^{1/2} \log n}-\int_1^N \frac{\sin(T\log t)}{t^{1/2}\log t}dt-$$ $$-\frac{\sin(T\log N)}{\log N}\Bigl(\sum_{n=1}^N\Lambda(n)n^{-1/2}-2N^{1/2} \Bigr)\Bigr]+$$ $$+\frac{1}{2\pi}\left(\operatorname{\rm am}\Gamma\left(\frac12+iT\right)-T\log T+T\right)+$$ $$+\frac{1}{\pi}\arctan(2T)-\frac{1}{4\pi}\arctan(\sinh(\pi T)),$$ where $\operatorname{\rm am} \Gamma(\frac12+it)$ is defined by making $\operatorname{\rm am} \Gamma(\frac12)=0$ and continuing analytically along any path not meeting the real axis.

Of course the sums where $\Lambda(n)$ appears can be considered sum about primes.

-
What is am? argument? –  Marc Palm Feb 9 '14 at 11:55
@MarcPalm Yes, but I maintained the notation in Guinand –  juan Feb 9 '14 at 19:54

Guinand's paper is accessible at archive.org (p.111)

-
I hope you get enough "reputation" to be able to post comments. –  Chandan Singh Dalawat Dec 26 '11 at 13:45

By accumulating/integrating the result from a variant of the Fourier transform of the von Mangoldt function I believe it should be possible:

Clear[f]
scale = 1000000;
f = Range[scale];

f[[1]] = N@MangoldtLambda[1];
Monitor[Do[
f[[i]] = N@MangoldtLambda[i] + f[[i - 1]], {i, 2, scale}], i]

xres = .002;
xlist = Exp[Range[0, Log[scale], xres]];
tmax = 60;
tres = .015;
s = 1/2;
Monitor[errList1 =
Table[((xlist^(-s + I t).(f[[Floor[xlist]]] - xlist)))*(s +
I t), {t, Range[0, 60, tres]}];, t]

Print["Variant of the Fourier transform of the von Mangoldt function"]
g1 = ListLinePlot[Accumulate[Re[errList1]/Length[xlist]],
DataRange -> {0, 60}, PlotRange -> {-.3, 300}, Axes -> True,
Filling -> Axis];
Show[g1, ImageSize -> Large]


I have put a picture of the result here:

http://mobiusfunction.files.wordpress.com/2012/07/zeta-zero-counting-function.png

The scale is wrong though and I don't know how to do it by integration, but the steps at x-values of imaginary parts of Riemann zeta zeros should all be roughly the same.

Edit 12.8.2012: The integration of the formula in the program above is not too hard to do:

Clear[xlist, s, t, g];
Integrate[((xlist^(-s + I t)*(g - xlist)))*(-s + I t), t]
Print["g=f[[Floor[xlist]]]"]
Clear[f]
scale = 1000000;
f = Range[scale];

f[[1]] = N@MangoldtLambda[1];
Monitor[Do[
f[[i]] = N@MangoldtLambda[i] + f[[i - 1]], {i, 2, scale}], i]

xres = .002;
xlist = Exp[Range[0, Log[scale], xres]];
xlist[[1]] = 1.001;
tmax = 60;
tres = .015;
s = 1/2;
Monitor[errList1 =
Table[Total[((f[[Floor[xlist]]] - xlist) xlist^(-s +
I t) (I + (I s + t) Log[xlist]))/Log[xlist]^2], {t,
Range[0, 60, tres]}];, t]

Print["Variant of the Fourier transform of the von Mangoldt function"]
g1 = ListLinePlot[Re[errList1]/Length[xlist] - 1,
DataRange -> {0, 60}, PlotRange -> {-0, 3.7}, Axes -> True];
Show[g1, ImageSize -> Full]


I have put picture of the result here:

http://mobiusfunction.files.wordpress.com/2012/08/zeta-zero-counting-august-2012.png

I don't know if it is entirely correct and the scaling is wrong. The minus one seems to make the counting start at the first zeta zero.

Edit 5.2.2014:

Using this as a starting point:

$$\Lambda(n)=\lim\limits_{s \rightarrow 1} \zeta(s)\sum\limits_{d|n} \frac{\mu(d)}{d^{(s-1)}}.$$

Where $\Lambda(n)$ is the von Mangoldt function.

Edit 4.2.2014:

The Dirichlet series:

$$f(t) = (1-\sum\limits_{n=1}^{n=k} \frac{1}{1.2\log(k)} \frac{1}{n} \zeta(1/2+i \cdot t)\sum\limits_{d|n} \frac{\mu(d)}{d^{(1/2+i \cdot t-1)}})^{12}$$

leads to a sequence of numbers that when accumulated gives the plot:

Mathematica code for the plot above:

scale = 400;
Print["Counting to 60"]
Monitor[g1 =
ListLinePlot[
Accumulate[(1 -
Table[Re[
Zeta[1/2 - I*k]*
Total[Table[
Total[MoebiusMu[Divisors[n]]/Divisors[n]^(1/2 - I*k - 1)]/
n/Log[scale]/1.2, {n, 1, scale}]]], {k, 0 + 1/1000, 60,
N[1/6]}])^12], DataRange -> {0, 60},
PlotRange -> {-0.15, 15}], Floor[k]]


Edit 13.2.2014:

(*program start*)
scale = 300;
Print["Counting to 60"]
Monitor[g1 =
ListLinePlot[
0.69*Accumulate[
Table[Exp[-Re[
Zeta[1/2 - I*k]*
Total[Table[
Total[MoebiusMu[Divisors[n]]/
Divisors[n]^(1/2 - I*k - 1)]/n, {n, 1, scale}]]]], {k,
0 + 1/1000, 60, N[1/6]}]], DataRange -> {0, 60},
PlotRange -> {-0.15, 15}];, Floor[k]]
Show[g1, ListPlot[Table[{N[Im[ZetaZero[n]]], n}, {n, 1, 13}],
PlotStyle -> Black, Filling -> Axis]]
(*program end*)


The plot below from the program above is something like:

$$f(k)=\exp \left(-\Re\left(\zeta \left(\frac{1}{2}-i k\right) \sum _{n=1}^{\text{scale}} \frac{\sum\limits_{d|n}\frac{\mu (d(n))}{d(n)^{-i k+\frac{1}{2}-1}}}{n}\right)\right)$$

-

This may not help you, but: With Excel I calculated the Discrete Fourier Transform of a function = unit spikes at locations of the logarithms of a few hundred primes. The zeta zeros (imaginary part) show up as spikes. But it only works for small numbers of primes and zeros. For a better approximation, I reversed the explicit formula in Riemann's, making the spike heights = ln(p)/sqrt(p), and included powers of primes at 1/exponent as much, like the Von Mangoldt function. That gave much cleaner results, valid for thousands of primes and zeros. However it does diverge (increasing oscillations) for really big values, because logs of primes get close (more than the zeta zeros in Reimann's formula). I'm leaving out some details. If you or anyone is interested, email me at robertjwalcott@yahoo.com for the spreadsheets or graphs.

-