It should be the case that, in some appropriate sense $$\pi (x)\sim \operatorname{Ri}(x)-\sum_{\rho}\operatorname{Ri}(x^{\rho}) \tag{4}\label{386213_4}$$ with $\operatorname{Ri}$ denoting the

Riemann functiondefined: $$\operatorname{Ri}(x)=\sum_{m=1}^\infty \frac{\mu (m)}{m}\operatorname{li}\left(x^{\frac{1}{m}}\right). \tag{5}\label{386213_5}$$ This relation\eqref{386213_4} has been called "exact" [in Ribenboim'sThe New Book of Prime Number Records], yet we could not locate a proof in the literature; such a proof should be nontrivial, as the conditionally convergent series involved are problematic. In any case relation \eqref{386213_4} is quite accurate, and furthermore the Riemann function $\operatorname{Ri}$ can be calculated efficiently. (…) The sum in \eqref{386213_4} overcritical zerosis not absolutely convergent, and furthermore the phases of the summands interact in a frightfully complicated way.

—from *Journal of Computational and Applied Mathematics by Borwein et al.*

Of profound importance, Bernhard Riemann proved that the prime-counting function is exactly $$\pi (x)=\operatorname{R}(x)-\sum_{\rho}\operatorname{R}(x^{\rho})$$ where $$\operatorname{R}(x)=\sum_{n=1}^\infty \frac{\mu (n)}{n}\operatorname{li}\left(x^{\frac{1}{n}}\right),$$ (...) $\rho$ indexes

every zeroof the Riemann zeta function, and $\operatorname{li}\left(x^{\frac{\rho}{n}}\right)$ is not evaluated with a branch cut but instead considered as $\operatorname{Ei}\left(\frac{\rho}{n}\ln x\right)$. Equivalently, if the trivial zeros are collected and the sum is takenonly over the non-trivial zeros$\rho$ of the Riemann zeta function, then $\pi (x)$ may be written $$\pi (x)=\operatorname{R}(x)-\sum_{\rho}\operatorname{R}(x^{\rho})-\frac{1}{\ln x}+\frac{1}{\pi}\arctan\frac{\pi}{\ln x}.$$

—from *Wikipedia's Prime-counting function article* (before 30/7/2021)

**Questions:**

According to Borwein and Ribenboim, the index in $(4)$ should run only over

**non-trivial zeros**. According to Wikipedia, the index in $(4)$ should run over**all zeros**. Wikipedia states that if the sum runs only over non-trivial zeros, then we add the $\ln$ and $\arctan$ terms, which is even more confusing. So what's true?I'm pretty sure that Riemann did not prove the formula $(4)$. He only

**proposed**a "weaker" form of it, namely $$\pi (x)=\sum_{m=1}^\infty \frac{\mu (m)}{m}J\left(x^{\frac{1}{m}}\right)$$ where $$J(x)=\operatorname{li}(x)-\sum_{\rho}\operatorname{li}\left(x^{\rho}\right)+\int_x^\infty \frac{dt}{t(t^2-1)\ln t}-\ln 2$$ and where $\rho$ runs over all non-trivial zeros. The formula was proven by Mangoldt, not Riemann. The Wikipedia article is wrong in that historical fact, isn't it?Even though the proof of \eqref{386213_4} is nowhere to be found in the literature, Raymond Manzoni provided a partial proof in this answer to Two Representations of the Prime Counting Function. I call it partial because it is unknown whether the series converges at all: How could that be settled down?

*Note:* When I refer to the formula \eqref{386213_4} in this question, I assume $=$ instead of $\sim$.

**Riesel and Gohl**

Riesel and Gohl show in *Some Calculations Related to Riemann's Prime Number Formula* that
$$\sum_{n=1}^N \frac{\mu (n)}{n}\left(\int_{x^{\frac{1}{n}}}^\infty \frac{\mathrm dt}{t(t^2-1)\ln t}-\ln 2\right)=\frac{1}{2\ln x}\sum_{n=1}^N \mu (n)+\frac{1}{\pi}\arctan\frac{\pi}{\ln x}+\epsilon (x,N)$$
where
$$\epsilon (x,N)=-\sum_{n=N+1}^\infty \frac{\mu (n)}{n}\left(\frac{1}{2}\ln\ln x+C\right)+\frac{1}{2}\sum_{n=N+1}^\infty \frac{\mu (n)\ln n}{n}+\sum_{n=N+1}^\infty \frac{\mu (n)}{n}\sum_{k=1}^\infty \frac{1}{\pi k}\arctan\frac{\ln x}{n\pi k}$$
where
$$C=\sum_{k=1}^\infty \frac{1}{\pi k}\arctan\frac{1}{\pi k}+\int_1^\infty \frac{\mathrm du}{u(e^{2u}-1)}-\ln 2+\frac{1}{2}.$$
Now, $\epsilon\to 0$ as $N\to\infty$.
If $\sum_{n=1}^\infty \mu (n)=-2$, then
$$\sum_{n=1}^\infty \frac{\mu (n)}{n}\int_{x^{\frac{1}{n}}}^\infty \frac{\mathrm dt}{t(t^2-1)\ln t}=\frac{1}{\pi}\arctan\frac{\pi}{\ln x}-\frac{1}{\ln x}.$$

But this uses the zeta-regularized result $\sum_{n=1}^\infty \mu (n)=-2$. It is one way of assigning a finite value to a divergent sum, obtained by just plugging $s=0$ in $$\frac{1}{\zeta (s)}=\sum_{n=1}^\infty \frac{\mu (n)}{n^s}.$$

In general, this assigning of values is arbitrary. There are lots of ways to do that. I don't understand how can this arbitrary choice produce an "empirically-correct" result about the distribution of prime numbers. In fact, the paper of Riesel and Gohl implies the mysterious formula $$\pi (x)= \operatorname{R}(x)-\sum_{\rho}\operatorname{R}(x^{\rho})-\frac{1}{\ln x}+\frac{1}{\pi}\arctan\frac{\pi}{\ln x}.$$ For the empirical results, see here.

**Questions [continued]:**

- What makes zeta-regularization (or other regularizations producing the same value) the only regularization that seems to produce the "empirically-correct" result? Or is it the case that the result is ultimately wrong?

*Note*: $\operatorname{li}x$ is to be interpreted as the Cauchy principal value of $\operatorname{Ei}\ln x$.

This question has been on MSE for some time, but it still doesn't have any answers, so I decided to post it here.

**Edit:**
The Wikipedia formula (before 30/7/2021)
$$\pi (x)= \operatorname{R}(x)-\sum_{\rho}\operatorname{R}(x^{\rho})-\frac{1}{\ln x}+\frac{1}{\pi}\arctan\frac{\pi}{\ln x}$$
turned out to be a misinterpretation of Riesel and Gohl.

17more comments