%I #10 Jan 30 2022 23:05:10
%S 1,1005,1053,1255,2006,2025,2246,2560,3712,4063,4066,4087,5006,5009,
%T 5038,5068,5076,5538,6000,6025,6045,7007,7025,7037,8068,8960,9009,
%U 9052,10007,10823,11003,11005,12000,12003,12134,12639,14009,14207,14326,14944,15052,16000
%N Numbers k such that the string k modulo 1000 is found at position k in the decimal digits of Pi.
%H Michael S. Branicky, <a href="/A153226/b153226.txt">Table of n, a(n) for n = 1..10000</a>
%e a(4) = 1255 because 255 occurs at offset 1255 after the decimal in the digits of Pi.
%o (Python)
%o from sympy import S
%o # download https://stuff.mit.edu/afs/sipb/contrib/pi/pi-billion.txt, then
%o #with open('pi-billion.txt', 'r') as f: pi_digits = f.readline()
%o pi_digits = str(S.Pi.n(3*10**5+2))[:-2] # alternative to above
%o pi_digits = pi_digits.replace(".", "")
%o def ispal(s): return s == s[::-1]
%o def agen():
%o for k in range(len(pi_digits)):
%o sk = str(k%1000)
%o if sk == pi_digits[k:k+len(sk)]:
%o yield k
%o g = agen()
%o print([next(g) for n in range(1, 43)]) # _Michael S. Branicky_, Jan 30 2022
%Y Cf. A000796, A057679, A057680, A109513, A109514.
%K base,nonn
%O 1,2
%A _Gil Broussard_, Dec 21 2008
%E a(40) and beyond from _Michael S. Branicky_, Jan 30 2022
|