A362551 a(0)=0. For each digit d in the sequence, append the smallest unused integer such that its last digit equals d.
0, 10, 1, 20, 11, 2, 30, 21, 31, 12, 3, 40, 22, 41, 13, 51, 61, 32, 23, 4, 50, 42, 52, 14, 71, 81, 33, 5, 91, 6, 101, 43, 62, 72, 53, 24, 15, 60, 34, 82, 25, 92, 111, 44, 7, 121, 8, 131, 63, 73, 35, 9, 141, 16, 151, 70, 161, 54, 83, 26, 102, 17, 112, 45, 93
Offset: 0
Examples
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).
Links
Programs
-
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
Comments