%I #59 Sep 30 2024 01:19:30
%S 5,12,281,547,6205,16350
%N Numbers k such that the initial k digits in decimal portion of Pi form a prime number.
%C Conjecture: this sequence is finite. - _Carlos Rivera_
%C Rivera's conjecture that this sequence is finite conflicts with heuristics; the next entry is almost certainly 6205, since floor((Pi-3)*10^6205) is (very) probably prime, though its proof may take decades. - _David Broadhurst_, Nov 08 2000
%C Floor((Pi-3)*10^6205) is a strong pseudoprime to all (1229) prime bases a < 10000 (the test took 45 minutes). - _Joerg Arndt_, Jan 16 2011
%C Terms for n>=5 are only probable primes. - _Dmitry Kamenetsky_, Aug 03 2015
%C Floor((Pi-3)*10^16350) is a probable prime, checked with 25 iterations of the Miller-Rabin test. - _Dmitry Kamenetsky_, Aug 05 2015
%C The next term is greater than 65400. - _Dmitry Kamenetsky_, Aug 09 2015
%C The next term is greater than 100000. - _Michael S. Branicky_, Sep 29 2024
%H C. K. Caldwell, <a href="https://t5k.org/curios/page.php?number_id=551">Prime Curios: 14159...07021 (547-digits)</a>
%e 5 gives 14159 (prime); 12 gives 141592653589 (prime) and so on.
%t nn=1000; d=RealDigits[Pi-3, 10, nn][[1]]; Select[Range[nn], PrimeQ[FromDigits[Take[d, #]]] &]
%o (PARI) is(n)=isprime((Pi-3)*10^n\1) \\ _Charles R Greathouse IV_, Aug 28 2015
%o (Python)
%o from sympy import S, isprime
%o pi_digits = str(S.Pi.n(10**5))[2:-1]
%o def afind():
%o kint = 0
%o for k in range(len(pi_digits)):
%o kint = 10*kint + int(pi_digits[k])
%o if isprime(kint):
%o print(k+1, end=", ")
%o afind() # _Michael S. Branicky_, Jan 29 2023
%Y Cf. A000796 (Pi), A060421, A064118.
%K hard,nice,nonn,base,more
%O 1,1
%A _Carlos Rivera_