- The second term in the Reimann’s function is computed by taking the logarithmic integral over x raised to non-trivial zeros of the zeta function.
- Since the sum is ‘conditionally convergent’, the summation should be done by taking the zeros of zeta function in a pair-wise fashion (taking ρ and 1-ρ) as follows
trying to compute Riemann's prime counting function J(x)
40 views (last 30 days)
I am trying to compute Riemann's prime counting function J(x):
J(x) should approximate the numbers of primes <= x using this code:
function J_RiemannPrimeCount = J(x)
if x < 2
error("x must be >= 2");
integral_fun = @(t) (1 ./ (t.*(t.^2-1).*log(t)));
integral_term = integral(integral_fun,x,Inf);
zetaZeros = 0.5 + csvread("first 100k zeros of the Riemann zeta.txt") .* i;
maxZero = 35;
k = 1:1:maxZero;
Li_term = logint(x.^zetaZeros(k)) - logint(2);
Li_sum = sum(Li_term);
J_RiemannPrimeCount = (logint(x) - logint(2)) - Li_sum - log(2) + integral_term;
The file "first 100k zeros of the Riemann zeta.txt" contains the Imag-values of the Riemann-zeta-function for Re = 0.5 (example: 14.134725142, 21.022039639, 25.010857580, 30.424876126, 32.935061588, ....) . I am using the first maxZero=35 of these to approximate J(x).
The periodic term "Li_sum = sum(Li_term)" is not correct - everything else should be fine. ( I am somewhat worried, that I am doing a super-stupid mistake here... )
Can anyone help nonetheless .. ??
Jyothis Gireesh on 18 Sep 2019
Here are a few pointers which may help with resolving the issue:
In the code given above, by restricting the zeros to the first 35 entries in the "first 100k zeros of the Riemann zeta.txt" file you may be violating the pair-wise summation condition causing the sum to diverge. So for ρ value in the first 35 entries you may add the corresponding 1-ρ value as well so that the sum term converges.
Johannes van Ek on 27 Mar 2021
Very interesting. I have the same problem. Did you manage to resolve this issue?
I do the summation over the conjugate pairs and it diverges.
I found a paper in Cantor's Paradise on this and it quotes converging results with 35 roots (and 100 roots), and it presents nice graphs of J(x). I do not know how the author got these results.
I also tried the cos(alpa(ln(x)) formulation from riemann's original paper. No success either. Puzzled.