A153226 Numbers k such that the string k modulo 1000 is found at position k in the decimal digits of Pi.
1, 1005, 1053, 1255, 2006, 2025, 2246, 2560, 3712, 4063, 4066, 4087, 5006, 5009, 5038, 5068, 5076, 5538, 6000, 6025, 6045, 7007, 7025, 7037, 8068, 8960, 9009, 9052, 10007, 10823, 11003, 11005, 12000, 12003, 12134, 12639, 14009, 14207, 14326, 14944, 15052, 16000
Offset: 1
Examples
a(4) = 1255 because 255 occurs at offset 1255 after the decimal in the digits of Pi.
Links
- Michael S. Branicky, Table of n, a(n) for n = 1..10000
Programs
-
Python
from sympy import S # download https://stuff.mit.edu/afs/sipb/contrib/pi/pi-billion.txt, then #with open('pi-billion.txt', 'r') as f: pi_digits = f.readline() pi_digits = str(S.Pi.n(3*10**5+2))[:-2] # alternative to above pi_digits = pi_digits.replace(".", "") def ispal(s): return s == s[::-1] def agen(): for k in range(len(pi_digits)): sk = str(k%1000) if sk == pi_digits[k:k+len(sk)]: yield k g = agen() print([next(g) for n in range(1, 43)]) # Michael S. Branicky, Jan 30 2022
Extensions
a(40) and beyond from Michael S. Branicky, Jan 30 2022