cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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

Original entry on oeis.org

1, 0, 5, -4, -39, -24, 1823, -6566, -1844, -34087, 84846, -449836, -1117632, -3465179, -1766196, -11290074, 105510354, -208774399, 704933861
Offset: 0

Views

Author

Cino Hilliard, Oct 06 2006

Keywords

Comments

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.

Examples

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

Crossrefs

Programs

  • PARI
    primeGR(n) =
    \\ A good approximation for the n-th prime number using
    \\ the Gram-Riemann approximation of Pi(x)
    { 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); }
    Rg(x) =
    \\ Gram's Riemann's Approx of Pi(x)
    { 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) }

Formula

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.
a(n) = A006988(n) - A121046(n) for n >= 1. - Amiram Eldar, Jul 04 2024

Extensions

a(17)-a(18) from Amiram Eldar, Jul 04 2024