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
Michael S. Branicky, Table of n, a(n) for n = 1..6491
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
KEYWORD
base,nonn
AUTHOR
Eric Angelini, Aug 15 2024
EXTENSIONS
a(46) and beyond from Michael S. Branicky, Aug 16 2024.
STATUS
approved
