A084383 a(0)=0; for n>0, a(n) = smallest number that is not a concatenation of any number of distinct earlier terms in increasing order.
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 20, 21, 22, 30, 31, 32, 33, 40, 41, 42, 43, 44, 50, 51, 52, 53, 54, 55, 60, 61, 62, 63, 64, 65, 66, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 112, 113, 114, 115, 116, 117, 118, 119, 200, 201, 202
Offset: 0
Links
- Michael S. Branicky, Table of n, a(n) for n = 0..10000
Programs
-
Python
from itertools import islice def incats(s, L): if s == "": return True return any(s.startswith(w) and incats(s[len(w):], L[i+1:]) for i, w in enumerate(L)) def agen(): # generator of terms L, an, s = ["0"], 1, "1" yield from [0] while True: yield an L.append(s) while incats((s:=str(an)), L): an += 1 print(list(islice(agen(), 70))) # Michael S. Branicky, Feb 01 2024
Extensions
More terms from Patrick De Geest, Jun 03 2003
Comments