login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A120843 Initial digit of the (10^n)-th prime. 1
2, 2, 5, 7, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,1
COMMENTS
The algorithm in the PARI program approximates the (10^n)-th prime to an accuracy of roughly n/2 + 1 digits. As a result, we are almost certain to get the initial digit correctly. It remains to prove this. Since the Riemann approximation of pi(x) is used as a boundary in the exponential bisection routine, it would seem that a proof is possible in view of the fact that bisection almost always guarantees convergence. "Almost" is an appropriate term here, as will be demonstrated when we let the initial parameter r2 = 1. For example, we can toggle print(dx) to check the convergence. For primex(1e116), we get 9.999999999999999999999999970 E115.
LINKS
FORMULA
a(n) = most significant digit of A006988(n). - Robert G. Wilson v, Jan 17 2017
a(n) = A000030(A006988(n)). - Michel Marcus, Jan 18 2017
EXAMPLE
The (10^3)-th prime is 7919, so a(3)=7.
MATHEMATICA
f[n_] := RealDigits[ n (Log[n] + Log[Log[n]] - 1 + (Log[Log[n]] - 2)/Log[n] - (Log[Log[n]]^2 - 6 Log[Log[n]] + 11)/(2 Log[n]^2)), 10, 10][[1, 1]]; f[1] = f[10] = 2; f[100] = 5; Array[ f[10^#] &, 105, 0] (* Robert G. Wilson v, Jan 15 2017 *)
PROG
(PARI) g(n) = print1(2", "); for(x=1, n, y=Vec(Str(primex(10^x))); print1(y[1]", "))
primex(n) = /* Efficient Algorithm to accurately approximate the n-th prime */ { local(x, px, r1, r2, r, p10, b, e); b=10; /*Select base*/ p10=log(n)/log(10); /*p10=pow of 10 n is to adjust in b^p10*/ if(Rg(b^p10*log(b^(p10+1)))< b^p10, m=p10+1, m=p10); r1 = 0; r2 = 2.718281828; /*Real kicker. if 1, it fails at 1e117*/ for(x=1, 360, r=(r1+r2)/2; px = Rg(b^p10*log(b^(m+r))); if(px <= b^p10, r1=r, r2=r); r=(r1+r2)/2.; ); (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^100*r, s=s+r/zeta(n+1)/n; n=n+1; r=r*L/n); (s) }
CROSSREFS
Sequence in context: A080880 A305606 A369634 * A205674 A021447 A136536
KEYWORD
base,nonn
AUTHOR
Cino Hilliard, Aug 18 2006
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 01:35 EDT 2024. Contains 371964 sequences. (Running on oeis4.)