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.

This page as a plain text file.
%I A375460 #22 Aug 16 2024 21:09:10
%S A375460 0,1,2,3,4,5,10,11,20,6,12,100,7,21,8,101,9,1000,13,14,10000,15,22,16,
%T A375460 30,17,110,18,100000,19,23,31,1000000,24,40,25,102,26,200,27,10000000,
%U A375460 28,32,41,33,103,34,111,35,1001,36,100000000,37,42,112,43,120,44,1010,45,1000000000
%N A375460 Lexicographically earliest sequence of distinct nonnegative terms arranged in successive chunks whose digitsum = 10.
%C A375460 The first integer that will never appear in the sequence is 29, as its digitsum exceeds 10.
%C A375460 From _Michael S. Branicky_, Aug 16 2024: (Start)
%C A375460 Infinite since A052224 is infinite (as are all sequences with digital sum 1..10).
%C A375460 a(6492) has 1001 digits. (End)
%H A375460 Michael S. Branicky, <a href="/A375460/b375460.txt">Table of n, a(n) for n = 1..6491</a>
%e A375460 The first chunk of integers with digitsum 10 is (0,1,2,3,4);
%e A375460 the next one is (5,10,11,20),
%e A375460 the next one is (6,12,100),
%e A375460 the next one is (7,21),
%e A375460 the next one is (8,101),
%e A375460 the next one is (9,1000),
%e A375460 the next one is (13,14,10000), etc.
%e A375460 The concatenation of the above chunks produce the sequence.
%o A375460 (Python)
%o A375460 from itertools import islice
%o A375460 def bgen(ds): # generator of terms with digital sum ds
%o A375460     def A051885(n): return ((n%9)+1)*10**(n//9)-1 # due to Chai Wah Wu
%o A375460     def A228915(n): # due to M. F. Hasler
%o A375460         p = r = 0
%o A375460         while True:
%o A375460             d = n % 10
%o A375460             if d < 9 and r: return (n+1)*10**p + A051885(r-1)
%o A375460             n //= 10; r += d; p += 1
%o A375460     k = A051885(ds)
%o A375460     while True: yield k; k = A228915(k)
%o A375460 def agen(): # generator of terms
%o A375460     an, ds_block = 0, 0
%o A375460     dsg = [None] + [bgen(i) for i in range(1, 11)]
%o A375460     dsi = [None] + [(next(dsg[i]), i) for i in range(1, 11)]
%o A375460     while True:
%o A375460         yield an
%o A375460         an, ds_an = min(dsi[j] for j in range(1, 11-ds_block))
%o A375460         ds_block = (ds_block + ds_an)%10
%o A375460         dsi[ds_an] = (next(dsg[ds_an]), ds_an)
%o A375460 print(list(islice(agen(), 61))) # _Michael S. Branicky_, Aug 16 2024
%Y A375460 Cf. A166311, A051885, A228915.
%Y A375460 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).
%K A375460 base,nonn
%O A375460 1,3
%A A375460 _Eric Angelini_, Aug 15 2024
%E A375460 a(46) and beyond from _Michael S. Branicky_, Aug 16 2024.