A076106 Out of all the n-digit primes, which one takes the longest time to appear in the digits of Pi (ignoring the initial 3)? The answer is a(n), and it appears at position A076130(n).
7, 73, 373, 9337, 35569, 805289, 9271903
Offset: 1
Examples
Of all the 2-digit primes, 11 to 97, the last one to appear in Pi is 73, at position 299 (see A076130). - _N. J. A. Sloane_, Nov 28 2019
Links
- Carlos Rivera, Puzzle 40. The Pi Prime Search Puzzle (by Patrick De Geest), The Prime Puzzles and Problems Connection.
Programs
-
Python
# download https://stuff.mit.edu/afs/sipb/contrib/pi/pi-billion.txt, then with open('pi-billion.txt', 'r') as f: digits_of_pi = f.readline()[2:] # from sympy import S # digits_of_pi = str(S.Pi.n(72*10**4))[2:] # alternate to loading data from sympy import primerange def A076106_A076130(n): global digits_of_pi bigp, bigloc = None, -1 for p in primerange(10**(n-1), 10**n): loc = digits_of_pi.find(str(p)) if loc == -1: print("not enough digits", n, p) if loc > bigloc: bigloc = loc bigp = p return (bigp, bigloc+1) print([A076106_A076130(n)[0] for n in range(1, 6)]) # Michael S. Branicky, Jul 08 2021
Extensions
Definition clarified by N. J. A. Sloane, Nov 28 2019
a(7) from Michael S. Branicky, Jul 08 2021
Comments