cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A381509 Numbers whose nonzero digits are in nondecreasing order and any zeros appear at the end.

Original entry on oeis.org

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

Views

Author

Keenin D. Krehbiel, Feb 25 2025

Keywords

Comments

This sequence includes all non-negative integers where non-zero digits (1-9) are in non-decreasing order and zeros are at the end.
Each term is a unique multiset of digits in canonical form.

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