Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
A101807
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.
1
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, 26, 27, 28, 29, 30, 100, 31, 101, 32, 102, 103, 104, 33, 105, 34, 106, 35, 107, 36, 108, 37, 109, 38, 110, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 111, 51, 52
OFFSET
1,3
COMMENTS
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
LINKS
PROG
(Python)
from itertools import count, islice
def agen(): # generator of terms
an, aset, dlst, m = 0, {0}, [None, 0], 1
for n in count(1):
yield an
an = next(k for k in count(m) if k not in aset and len(str(k)) != dlst[n])
aset.add(an)
dlst.extend(map(int, str(an)))
while m in aset: m += 1
print(list(islice(agen(), 65))) # Michael S. Branicky, Oct 04 2024
CROSSREFS
Sequence in context: A176998 A328752 A173821 * A248025 A303501 A368347
KEYWORD
base,easy,nonn
AUTHOR
Eric Angelini, Jan 27 2005
EXTENSIONS
Offset changed and a(33) and beyond from Michael S. Branicky, Oct 04 2024
STATUS
approved