%I #8 Oct 04 2024 08:52:00
%S 0,1,10,11,2,12,13,3,14,4,15,5,6,16,7,8,17,9,18,19,20,21,22,23,24,25,
%T 26,27,28,29,30,100,31,101,32,102,103,104,33,105,34,106,35,107,36,108,
%U 37,109,38,110,39,40,41,42,43,44,45,46,47,48,49,50,111,51,52
%N Start with 0 and decide that each digit d of the sequence means that the next integer cannot be of length d. To build the sequence take the smallest available integer not yet in the sequence.
%C The first 0 means: "next integer cannot be of length zero", thus "1" ("1" being the first available integer not yet in the sequence). Now this "1" reads: "next integer cannot be of length one", thus 10 ("10" being the first two-digit integer not yet in the sequence). The next digit to be read is the "1" digit of this "10": "next integer cannot be of length one", thus 11 ("11" being the smallest two-digit integer not yet in the sequence). The next digit to be read is the "0" digit of "10" which produces "2" ("2" is not of length zero and is the smallest available integer after "1", already in the sequence) "next 10 11 2 12 13 3 14 4 15
%H Michael S. Branicky, <a href="/A101807/b101807.txt">Table of n, a(n) for n = 1..10000</a>
%o (Python)
%o from itertools import count, islice
%o def agen(): # generator of terms
%o an, aset, dlst, m = 0, {0}, [None, 0], 1
%o for n in count(1):
%o yield an
%o an = next(k for k in count(m) if k not in aset and len(str(k)) != dlst[n])
%o aset.add(an)
%o dlst.extend(map(int, str(an)))
%o while m in aset: m += 1
%o print(list(islice(agen(), 65))) # _Michael S. Branicky_, Oct 04 2024
%K base,easy,nonn
%O 1,3
%A _Eric Angelini_, Jan 27 2005
%E Offset changed and a(33) and beyond from _Michael S. Branicky_, Oct 04 2024