OFFSET
1,1
COMMENTS
Start with the first digit of Pi and set a(1)=3. Let p(1),...,p(i) be the digits of Pi used to construct a(1),...,a(n); then a(n+1) is the smallest integer with digits p(i+1),...,p(i+j) such that a(n+1) is new and p(i+j+1) != 0.
Is the sequence a permutation of the positive integers?
LINKS
Paul Tek, Table of n, a(n) for n = 1..10000
EXAMPLE
Pi = 3.141592653589...
PROG
(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
CROSSREFS
KEYWORD
AUTHOR
Klaus Strassburger (strass(AT)ddfi.uni-duesseldorf.de), Oct 22 2001
STATUS
approved