login
A037089
Lexicographically earliest strictly increasing decimal autovarious sequence: a(n) = number of distinct n-digit endings (left-zero-padded) of terms in the sequence.
1
1, 2, 11, 12, 21, 22, 31, 32, 41, 42, 51, 101, 1001, 1002, 1011, 1012, 1021, 1022, 1031, 1032, 1041, 10001, 100001, 100002, 100011, 100012, 100021, 100022, 100031, 100032, 100041, 1000001, 10000001, 10000002, 10000011, 10000012
OFFSET
0,2
COMMENTS
The first a(n) terms include all a(n) n-digit endings.
LINKS
PROG
(Python)
a, m, n, i = [1, 2, 11], 1, 1, 0
while len(a) <= 100:
while (a[-1]==a[-2] or not all(len(set([x % (10 ** j) for x in a])) <= a[j] for j in range(1, len(a)-1))):
i += 1
if (i == len(a)-1):i, m = 0, m+1
a[-1] = (m*(10**n))+a[i]
if (len(a) in a): m, n, i = 1, n+1, 0; a.append((10**n)+1)
else: a.append(a[-1])
a.pop(); print(a) # Dominic McCarty, Jan 29 2025
CROSSREFS
Sequence in context: A096109 A136997 A085184 * A038118 A038117 A038116
KEYWORD
nonn,base,nice
STATUS
approved