A047658 Numbers k such that the initial k digits in decimal portion of Pi form a prime number.
5, 12, 281, 547, 6205, 16350
Offset: 1
Examples
5 gives 14159 (prime); 12 gives 141592653589 (prime) and so on.
Links
- Chris K. Caldwell, Prime Curios: 14159...07021 (547-digits)
- Shyam Sunder Gupta, Mystery of pi, Exploring the Beauty of Fascinating Numbers, Springer (2025) Ch. 19, 473-497.
Programs
-
Mathematica
nn=1000; d=RealDigits[Pi-3, 10, nn][[1]]; Select[Range[nn], PrimeQ[FromDigits[Take[d, #]]] &]
-
PARI
is(n)=isprime((Pi-3)*10^n\1) \\ Charles R Greathouse IV, Aug 28 2015
-
Python
from sympy import S, isprime pi_digits = str(S.Pi.n(10**5))[2:-1] def afind(): kint = 0 for k in range(len(pi_digits)): kint = 10*kint + int(pi_digits[k]) if isprime(kint): print(k+1, end=", ") afind() # Michael S. Branicky, Jan 29 2023
Comments