A064809 Decimal expansion of Pi written as a sequence of positive integers avoiding duplicates.
3, 1, 4, 15, 9, 2, 6, 5, 35, 8, 97, 93, 23, 84, 62, 64, 33, 83, 27, 950, 28, 841, 971, 69, 39, 937, 510, 58, 20, 974, 94, 45, 92, 30, 7, 81, 640, 628, 620, 89, 98, 6280, 34, 82, 53, 42, 11, 70, 67, 982, 14, 80, 86, 51, 32, 8230, 66, 470, 938, 44, 60, 95, 50, 582, 231, 72
Offset: 1
Examples
Pi = 3.141592653589...
Links
- Paul Tek, Table of n, a(n) for n = 1..10000
Crossrefs
Cf. A000796.
Programs
-
Python
from itertools import islice 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(10**5))[:-1] # alternative to above pi_digits = pi_digits.replace(".", "") def diggen(): yield from map(int, pi_digits) def agen(): # generator of terms g = diggen() aset, nextd = set(), next(g) while True: an, nextd = nextd, next(g) while an in aset or nextd == 0: an, nextd = int(str(an) + str(nextd)), next(g) yield an aset.add(an) print(list(islice(agen(), 66))) # Michael S. Branicky, Mar 31 2022
Comments