OFFSET
0,2
COMMENTS
This sequence is a permutation of the nonnegative integers.
LINKS
EXAMPLE
a(0) = 0
a(1) = 10 (d=0 from a(0)=0, smallest integer other than 0 that ends with 0).
a(2) = 1 (d=1 from a(1)=10, smallest integer that ends with a 1).
a(3) = 20 (d=0 from a(1)=10, smallest integer other than 0 and 10 that ends with 0).
a(4) = 11 (d=1 from a(2)=1, smallest integer other than 1 that ends with 1).
a(5) = 2 (d=2 from a(3)=20, smallest integer that ends with 2).
a(6) = 30 (d=0 from a(3)=20, smallest integer other than 0, 10, and 20 that ends with 0).
PROG
(Python)
from itertools import count, islice
def agen(): # generator of terms
s, lastd = "0", [(k for k in count(i, 10)) for i in range(10)]
for n in count(0):
an = next(lastd[int(s[0])])
s = s[1:] + str(an)
yield an
print(list(islice(agen(), 65))) # Michael S. Branicky, Apr 25 2023
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Gavin Lupo, Apr 24 2023
STATUS
approved