Hi , would still greatly appreciate if anyone has an idea on this here:
When calculating the explicit Riemann prime counting function J(x) for x=2,...,1000 using the program below, I get an oscillating term Li_sum that looks like in the diagram (see attachement). The local maxima are in the right place (= at the exact locations of the prime numbers): however Li_sum should not be descending in the way it is doing here, but should be distributed around zero, since it is "only" the error term in the smooth estimation. So there must be a kind of "adjustment"-factor somewhere - maybe resulting from the fact that Li_sum is the truncated version of a conditionally convergent series.
% explicit Riemann Prime Counting function J
function J_RiemannPrimeCount = J(x)
if x < 2
error("x must be >= 2");
end
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 = 1000;
k = 1:1:maxZero;
Li_term = logint(x .^ zetaZeros(k)) + logint(x .^ (1-zetaZeros(k))) - 2*logint(2) ;
Li_sum = sum(Li_term);
J_RiemannPrimeCount_smooth = (logint(x) - logint(2)) - log(2) + integral_term; % prime estimation without oscillating term
J_RiemannPrimeCount = (logint(x) - logint(2)) - log(2) + integral_term - Li_sum; % prime counting with oscillating term
end
Any idea, where the error could be ... ???