|
|
A362371
|
|
a(0)=0. For each digit in the sequence, append the smallest unused integer that contains that digit.
|
|
3
|
|
|
0, 10, 1, 20, 11, 2, 30, 12, 13, 21, 3, 40, 14, 22, 15, 23, 24, 16, 31, 4, 50, 17, 34, 25, 26, 18, 5, 27, 32, 28, 41, 19, 6, 33, 51, 42, 35, 60, 61, 7, 36, 43, 29, 45, 52, 46, 71, 8, 53, 62, 37, 38, 72, 82, 48, 44, 81, 91, 9, 56, 39, 63, 54, 100, 47, 92, 73
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,2
|
|
LINKS
|
|
|
EXAMPLE
|
a(0) = 0
a(1) = 10 (from digit 0 in a(0)=0, smallest integer other than 0).
a(2) = 1 (from digit 1 in a(1)=10, smallest integer other than 10).
a(3) = 20 (from digit 0 in a(1)=10, smallest integer other than 0 and 10).
a(4) = 11 (from digit 1 in a(2)=1, smallest integer other than 1 and 10).
a(5) = 2 (from digit 2 in a(3)=20, smallest integer other than 20).
a(6) = 30 (from digit 0 in a(3)=20, smallest integer other than 0, 10, and 20).
|
|
PROG
|
(Python)
from itertools import count, islice
def agen(): # generator of terms
s, aset, mink = "0", set(), 0
for n in count(0):
an = mink
while an in aset or set(san:=str(an)) & {s[0]} == set(): an += 1
s = s[1:] + san
aset.add(an)
yield an
while mink in aset: aset.discard(mink); mink += 1
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|