login
This site is supported by donations to The OEIS Foundation.
Logo

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A120843 Initial digit of the (10^n)-th prime. 0
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; 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

EXAMPLE

The (10^3)-th prime is 7919. So 7 is the 4th term.

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 bonks 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: A028410 A050216 A080880 * A205674 A021447 A136536

Adjacent sequences:  A120840 A120841 A120842 * A120844 A120845 A120846

KEYWORD

base,nonn

AUTHOR

Cino Hilliard (hillcino368(AT)gmail.com), Aug 18 2006

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
Recent Additions | More pages | Superseeker | Maintained by The OEIS Foundation Inc.

Content is available under The OEIS End-User License Agreement .

Last modified February 15 09:26 EST 2012. Contains 205753 sequences.