A381509 Numbers whose nonzero digits are in nondecreasing order and any zeros appear at the end.
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 22, 23, 24, 25, 26, 27, 28, 29, 30, 33, 34, 35, 36, 37, 38, 39, 40, 44, 45, 46, 47, 48, 49, 50, 55, 56, 57, 58, 59, 60, 66, 67, 68, 69, 70, 77, 78, 79, 80, 88, 89, 90, 99, 100, 110, 111, 112, 113, 114, 115, 116, 117
Offset: 1
Examples
112 is in the sequence because 1 <= 1 <= 2. 120 is in the sequence because 1 <= 2, then 0. 21 is not in the sequence because 2 > 1. 102 is not in the sequence because the zero is not at the end.
Crossrefs
A variant of A179239.
Programs
-
Python
from itertools import combinations_with_replacement as cwr, count, islice def agen(): # generator of terms yield 0 for d in count(1): yield from sorted(int(f+"".join(mc)) for f in "123456789" for mc in cwr([str(i) for i in range(int(f), 10)]+["0"], d-1)) print(list(islice(agen(), 1000))) # Michael S. Branicky, Apr 11 2025
Comments