|
|
A064809
|
|
Decimal expansion of Pi written as a sequence of positive integers avoiding duplicates.
|
|
3
|
|
|
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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
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
|
|
|
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)
|
|
CROSSREFS
|
|
|
KEYWORD
|
|
|
AUTHOR
|
Klaus Strassburger (strass(AT)ddfi.uni-duesseldorf.de), Oct 22 2001
|
|
STATUS
|
approved
|
|
|
|