login
A375460
Lexicographically earliest sequence of distinct nonnegative terms arranged in successive chunks whose digitsum = 10.
2
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,3
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)
LINKS
EXAMPLE
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.
PROG
(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
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).
Sequence in context: A023787 A032983 A204388 * A348255 A117360 A074821
KEYWORD
base,nonn
AUTHOR
Eric Angelini, Aug 15 2024
EXTENSIONS
a(46) and beyond from Michael S. Branicky, Aug 16 2024.
STATUS
approved