# Greetings from The On-Line Encyclopedia of Integer Sequences! http://oeis.org/ Search: id:a198344 Showing 1-1 of 1 %I A198344 #25 Dec 29 2022 09:12:29 %S A198344 1,1,8,3,2,1,4,34,30,5,15,2,6,17,36,82,12,87,26,12,25,215,35,18,17,3, %T A198344 41,17,234,17,167,92,251,15,9,12,31,1,57,290,4,99,218,502,48,164,198, %U A198344 201,128,7,363,143,11,138,487,32,230,82,355,515,334,186,176,223 %N A198344 Position of the first n-digit prime occurring in the decimal expansion of Pi, A000796. %C A198344 Differs from A104842 in a(22), a(43), a(55),..., because here, leading zeros are not allowed. %C A198344 The corresponding primes are listed in A104841. %C A198344 Among the first 99 terms, even though values up to 825 occur, the values 1 and 17 occur 4 times, 12 and 57 occur 3 times, and numbers as large as 82, 164, 167 and 234 occur twice. %H A198344 Michael S. Branicky, Table of n, a(n) for n = 1..1000 (terms 1..162 from M. F. Hasler) %e A198344 a(1)=1 because the initial digit "3" of Pi is prime. %e A198344 a(2)=a(6)=a(38)=1 because the first 2, 6, and 38 digits of Pi (including the initial 3) also form the primes 31, 314159 and 31415926535897932384626433832795028841, cf. A005042 and A060421. %t A198344 With[{pd=RealDigits[Pi,10,1000][[1]]},Table[Position[Partition[pd,n,1],_?(PrimeQ[FromDigits[#]]&&#[[1]]!=0&),{1},1,Heads->False],{n,60}]]// Flatten (* _Harvey P. Dale_, Apr 25 2016 *) %o A198344 (PARI) A198344(n)=for(c=0,9e9,ispseudoprime(Pi\.1^(n+c-1)%10^n)&Pi\.1^c%10&return(c+1)) /* Replace upper limit 9e9 by "default(realprecision)-n" to avoid an error message and return 0 in case no n-digit prime is found */ %o A198344 (Python) # uses code in A104841 %o A198344 print([A104841_A198344(n)[1] for n in range(1, 65)]) # _Michael S. Branicky_, Dec 28 2022 %Y A198344 Cf. A000796, A272304. %Y A198344 Cf. A005042, A060421, A104841, A104842. %K A198344 nonn,base %O A198344 1,3 %A A198344 _M. F. Hasler_, Oct 23 2011 # Content is available under The OEIS End-User License Agreement: http://oeis.org/LICENSE