1

Prime counting function can be expressed as follows: $\pi(x) = \operatorname{R}(x) - \sum_{\rho}\operatorname{R}(x^{\rho}) \tag{1}$ where R(x) is Riemann's R-function and $\rho$-s are zeros of Riemann zeta function. I am able to evaluate R(x) for any x. I can also evaluate the sum over trivial zeros of zeta function, which converges rapidly. The problem I have is evaluating the sum over the non-trivial zeros. It seems to diverge. I always read somewhere that including more non-trivial zeros you get more accurate approximation of $\pi(x)$. But for me the best approximate is not using any zeros $\pi(x) \sim \operatorname{R}(x)$.

When I use no zeros $\pi(x) \sim \operatorname{R}(x)$ I get blue line (see image).

When I use first pair of nontrivial zeros $\pi(x) \sim \operatorname{R}(x)-(\operatorname{R}(x^{\rho_1})+\operatorname{R}(x^{\rho_{-1}}))$ I get yellow line.

When I use first two pairs of nontrivial zeros $\pi(x) \sim \operatorname{R}(x)-(\operatorname{R}(x^{\rho_1})+\operatorname{R}(x^{\rho_{-1}})+\operatorname{R}(x^{\rho_2})+\operatorname{R}(x^{\rho_{-2}}))$ I get green line (same image). (Red line is $\pi(x)$)

With more zeros it gets worse and worse, but the apposite should be true. What am I doing wrong?

azerbajdzan
  • 1,166

3 Answers3

1

Your issue is your implementation of $\mathrm{R}(x)$. You can't use a 1-argument $\mathrm{li}(x)$ here due to its branch cut, which prevents it from properly inverting $x^{\rho/n}$.

Apply $\mathrm{li}(x^y) = \mathrm{li}(e^{y \ln x}) = \mathrm{Ei}(y \ln x)$ to obtain

$$ \mathrm{R}(x^\rho) = \mathrm{R}(x, \rho) = \sum_{n=1}^∞ \frac{\mu(n)}{n} \mathrm{Ei}(\frac{\rho}{n} \ln(x)) $$

Removing $\rho$ from the exponent has eschewed crossing the branch cut. This form gave great convergence over your graphs' domains with 20 paired zeros and a summation to $n<\sqrt x$.

  • But this formula is dependent on Möbius function, which requires factorization of all numbers up to $n$. So we are moving inside a loop - tell me factorizations of all numbers then I tell you how much primes there is. But if I already knew factorizations I do not need some complicated formula to count primes because I already knew them. I hoped for a formula that uses definition: ${\displaystyle \operatorname {R} (x)=1+\sum _{k=1}^{\infty }{\frac {(\ln x)^{k}}{k!k\zeta (k+1)}}}$ which is totally independent from knowing primes. – azerbajdzan May 20 '19 at 10:23
0

This is probably because whatever you're using inteprets the logarithm in the definition of the R function as the principal branch of log (x^rho) when it should instead be rho times log (x) I don't know a program that implements the R function like that so you must work each term out by yourself: replace the RiemannR (x^rho) with (1+ sum k=1...inf (rho*log (x))^k!/k/zeta (k+1) ) http://www.jstor.org/stable/2004630

  • Please use MathJax to provide mathematical equations: https://math.meta.stackexchange.com/questions/5020/mathjax-basic-tutorial-and-quick-reference – jvdhooft Jun 02 '17 at 09:43
  • 1
    The best advice is to forget about $\pi(x)$ and look instead at $\psi(x) = x - \sum_\rho \frac{x^\rho}{\rho}-\ln 2\pi - \frac12 \ln(1-x^{-2})$ – reuns Jun 02 '17 at 13:15
  • @Just Some Nerdy Teen It does not work even if I replace $\ln(x^{\rho})$ with $\rho \ln(x)$. – azerbajdzan Nov 17 '17 at 17:34
  • @reuns OK, I looked at that instead and think I understand that part. Now can we return to $\pi(x)$? This part I still do not understand. – azerbajdzan Nov 17 '17 at 17:47
0

Also it should actually be RiemannR (x)+arctan (pi/log(x))/pi-1/log(x)-sum k=1...inf (RiemannR (x^rho(k))+RiemannR (x^rho (-k))) where rho denotes ONLY the nontrivial zeros and the last summands again need to be interpreted as what I just said.

Source: http://www.jstor.org/stable/2004630 (you can read it for free online ;3)

  • It does not work even if I replace $\ln(x^{\rho})$ with $\rho \ln(x)$ – azerbajdzan Nov 17 '17 at 17:34
  • No, those are equivalent. The summation over the trivial zeros is equivalent to the $-1/\ln{x} + 1/\pi \arctan{\pi / \ln{x}}$ term. @azerbajdzan's problem is his evaluation of the Riemann R function. You cannot use any 1-argument form here due to the branch cut. – alexchandel May 19 '19 at 18:03