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.

A375460 Lexicographically earliest sequence of distinct nonnegative terms arranged in successive chunks whose digitsum = 10.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 10, 11, 20, 6, 12, 100, 7, 21, 8, 101, 9, 1000, 13, 14, 10000, 15, 22, 16, 30, 17, 110, 18, 100000, 19, 23, 31, 1000000, 24, 40, 25, 102, 26, 200, 27, 10000000, 28, 32, 41, 33, 103, 34, 111, 35, 1001, 36, 100000000, 37, 42, 112, 43, 120, 44, 1010, 45, 1000000000
Offset: 1

Views

Author

Eric Angelini, Aug 15 2024

Keywords

Comments

The first integer that will never appear in the sequence is 29, as its digitsum exceeds 10.
From Michael S. Branicky, Aug 16 2024: (Start)
Infinite since A052224 is infinite (as are all sequences with digital sum 1..10).
a(6492) has 1001 digits. (End)

Examples

			The first chunk of integers with digitsum 10 is (0,1,2,3,4);
the next one is (5,10,11,20),
the next one is (6,12,100),
the next one is (7,21),
the next one is (8,101),
the next one is (9,1000),
the next one is (13,14,10000), etc.
The concatenation of the above chunks produce the sequence.
		

Crossrefs

Numbers with digital sum 1..10: A011557 (1), A052216 (2), A052217 (3), A052218 (4), A052219 (5), A052220 (6), A052221 (7), A052222 (8), A052223 (9), A052224 (10).

Programs

  • Python
    from itertools import islice
    def bgen(ds): # generator of terms with digital sum ds
        def A051885(n): return ((n%9)+1)*10**(n//9)-1 # due to Chai Wah Wu
        def A228915(n): # due to M. F. Hasler
            p = r = 0
            while True:
                d = n % 10
                if d < 9 and r: return (n+1)*10**p + A051885(r-1)
                n //= 10; r += d; p += 1
        k = A051885(ds)
        while True: yield k; k = A228915(k)
    def agen(): # generator of terms
        an, ds_block = 0, 0
        dsg = [None] + [bgen(i) for i in range(1, 11)]
        dsi = [None] + [(next(dsg[i]), i) for i in range(1, 11)]
        while True:
            yield an
            an, ds_an = min(dsi[j] for j in range(1, 11-ds_block))
            ds_block = (ds_block + ds_an)%10
            dsi[ds_an] = (next(dsg[ds_an]), ds_an)
    print(list(islice(agen(), 61))) # Michael S. Branicky, Aug 16 2024

Extensions

a(46) and beyond from Michael S. Branicky, Aug 16 2024.