OFFSET
1,2
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..10000
EXAMPLE
Digit 1 is < 2; 2 is < 3; etc. Then comes 8: if we write 9 after 8, the sequence stops (as there is no digit > 9). This forces a(9) = 19 (instead of 9) as the smallest available integer not leading to a contradiction. Integers consisting only of 9s (9, 99, 999, etc.) will thus never be part of the sequence.
PROG
(Python)
from itertools import islice
def agen(): # generator of terms
an, aset, mink = 1, {1}, 2
while True:
yield an
k, m = mink, min(str(an))
while k in aset or (s:=set(str(k))) == {"9"} or max(s) <= m:
k += 1
an = k
aset.add(an)
while mink in aset or set(str(mink)) == {"9"}:
aset.discard(mink); mink += 1
print(list(islice(agen(), 70))) # Michael S. Branicky, Jun 05 2023
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Eric Angelini, Jun 05 2023
STATUS
approved