login
Difference between the (10^n)-th prime and the Riemann-Gram approximation of the (10^n)-th prime.
0

%I #31 Jul 04 2024 03:33:57

%S 1,0,5,-4,-39,-24,1823,-6566,-1844,-34087,84846,-449836,-1117632,

%T -3465179,-1766196,-11290074,105510354,-208774399,704933861

%N Difference between the (10^n)-th prime and the Riemann-Gram approximation of the (10^n)-th prime.

%C The algorithm in the PARI script below produces the 10^n-th prime accurate to first n/2 places. Conjecture: The sign of the terms in this sequence changes infinitely often. Based on the small sample presented here, it appears the negative terms occur much more often.

%F prime(10^x)-primeRG(10^x), where prime(n) is the n-th prime and primeRG(n)is an approximation of the n-th prime number based on an exponential bisection routine that uses the Riemann-Gram approximation of Pi(x). The flow of the routine is evident in the PARI script below.

%F a(n) = A006988(n) - A121046(n) for n >= 1. - _Amiram Eldar_, Jul 04 2024

%e a(1) = prime(10) - primeGR(10) = 29 - 29 = 0.

%o (PARI)

%o primeGR(n) =

%o \\ A good approximation for the n-th prime number using

%o \\ the Gram-Riemann approximation of Pi(x)

%o { local(x,px,r1,r2,r,p10,b,e); b=10; p10=log(n)/log(10); if(Rg(b^p10*log(b^(p10+1)))< b^p10,m=p10+1,m=p10); r1 = 0; r2 = 7.18281828; for(x=1,400, r=(r1+r2)/2; px = Rg(b^p10*log(b^(m+r))); if(px <= b^p10,r1=r,r2=r); r=(r1+r2)/2; ); floor(b^p10*log(b^(m+r))+.5); }

%o Rg(x) =

%o \\ Gram's Riemann's Approx of Pi(x)

%o { local(n=1,L,s=1,r); L=r=log(x); while(s<10^40*r, s=s+r/zeta(n+1)/n; n=n+1; r=r*L/n); (s) }

%Y Cf. A006988, A121046.

%K sign,hard,more

%O 0,3

%A _Cino Hilliard_, Oct 06 2006

%E a(17)-a(18) from _Amiram Eldar_, Jul 04 2024