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!)
A104842 Position of the first sequence of n subsequent digits of Pi which form a prime. 20

%I #21 Dec 08 2018 03:28:05

%S 1,1,8,3,2,1,4,34,30,5,15,2,6,17,36,82,12,87,26,12,25,133,35,18,17,3,

%T 41,17,234,17,167,92,251,15,9,12,31,1,57,290,4,99,98,502,48,164,198,

%U 201,128,7,363,143,11,138,196,32,230,82,292,515,334,186,176,223,57,135,35

%N Position of the first sequence of n subsequent digits of Pi which form a prime.

%C Note that values with indices n = 22, 43, 55, ... are positions of primes with leading zeros, which is in particular manifest from a(42)=99, a(43)=98. See A198344 for the position of the "true" n-digit primes listed in A104841. - _M. F. Hasler_, Oct 23 2011

%e a(1)=1 since the first single-digit prime found, 3, is at first place, hence a(1)=1,

%e a(2)=1 since the first two-digit prime found, 31, is at first place, hence a(2)=1,

%e a(3)=8 since the first three-digit prime found, 653, is at 8th place, hence a(3)=8, ...

%t pi = RealDigits[Pi, 10, 100][[1]]; f[n_] := Block[{k = 1}, While[ !PrimeQ[ FromDigits[ Take[pi, {k, k + n - 1}]]], k++ ]; k]; Table[ f[n], {n, 67}] (* _Robert G. Wilson v_, Mar 29 2005 *)

%o (PARI) a(n)={for(c=-1,default(realprecision)-n-2,ispseudoprime(Pi\.1^(n+c)%10^n)&return(c+2));error("Insufficient realprecision, please increase.")} \\ _M. F. Hasler_, Oct 23 2011

%Y Cf. A104819 - A104841, A198344.

%K nonn,base

%O 1,3

%A _Zak Seidov_, Mar 27 2005

%E More terms from a(33) onward from _Robert G. Wilson v_, Mar 29 2005

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 24 15:18 EDT 2024. Contains 371960 sequences. (Running on oeis4.)