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!)
A037024 Position of start of first occurrence of prime(n) after the decimal point in expansion of Pi. 4

%I #15 Sep 08 2022 08:44:52

%S 6,9,4,13,94,110,95,37,16,186,137,46,2,23,119,8,4,219,98,39,299,13,26,

%T 11,12,852,3486,1487,206,362,297,1096,859,525,2606,393,1657,1410,1182,

%U 428,438,728,1944,168,37,704,93,135,484,185,229,1688,1707,1713,1006

%N Position of start of first occurrence of prime(n) after the decimal point in expansion of Pi.

%H Michael S. Branicky, <a href="/A037024/b037024.txt">Table of n, a(n) for n = 1..10000</a>

%H Dave Andersen, <a href="http://www.angio.net/pi/piquery">The Pi-Search Page</a>

%e Pi = 3.14159265358979323846264338327950288... (see A000796).

%e First occurrence of prime(23) = 83 starts at the 26th digit after the decimal point, hence a(23) = 26.

%o (Magma) k:=3500; R := RealField(k); [ Position(IntegerToString(Round(10^k*(-3 + Pi(R)))), IntegerToString(NthPrime(n))) : n in [1..55] ]; /* _Klaus Brockhaus_, Feb 15 2007 */

%o (Python)

%o from itertools import takewhile

%o from sympy import S, prime, primerange

%o # download https://stuff.mit.edu/afs/sipb/contrib/pi/pi-billion.txt, then

%o # with open('pi-billion.txt', 'r') as f: pi_digits = f.readline()[1:]

%o pi_digits = str(S.Pi.n(10**4))[1:] # alternative to above

%o def aupton(nn):

%o plocs = (pi_digits.find(str(p)) for p in primerange(2, prime(nn)+1))

%o return list(takewhile(lambda x: x>=0, plocs)) # until p not found

%o print(aupton(55)) # _Michael S. Branicky_, Jun 12 2021

%Y Cf. A000796, A014777.

%K nonn,base

%O 1,1

%A _Patrick De Geest_, Jan 04 1999

%E Edited by _Klaus Brockhaus_, Feb 15 2007

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 06:49 EDT 2024. Contains 371964 sequences. (Running on oeis4.)