login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A363490
Lexicographically earliest infinite sequence of distinct terms > 0 such that one digit of a(n) is strictly smaller than one digit of a(n+1).
1
1, 2, 3, 4, 5, 6, 7, 8, 19, 12, 13, 14, 15, 16, 17, 18, 20, 10, 11, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70
OFFSET
1,2
LINKS
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
Cf. A294069.
Sequence in context: A055557 A173577 A103205 * A039127 A024650 A037343
KEYWORD
base,nonn
AUTHOR
Eric Angelini, Jun 05 2023
STATUS
approved