OFFSET
1,1
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..10000
EXAMPLE
We construct S as follows, starting with S = {}.
0 is missing, so S = {0};
1 is missing, so S = {0,1};
10 is missing, so S = {0,1,0};
11 is missing, so S = {0,1,0,1,1};
100 is missing, so S = {0,1,0,1,1,0,0};
101 and 110 are visible, but 111 is missing, so S = {0,1,0,1,1,0,0,1,1,1}; etc.
PROG
(Python)
from itertools import count, islice, product
def a(): # generator of terms
S = ""
for m in count(0):
Sm = bin(m)[2:]
if Sm in S: continue
for i in range(1, len(Sm)+1):
v = Sm[-i:]
t = "" if len(v) == len(Sm) else S[-len(Sm)+i:]
if t+v == Sm: break
S += v
yield from list(map(int, v))
print(list(islice(a(), 105))) # Michael S. Branicky, Oct 27 2023
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, Jun 23 2005
EXTENSIONS
More terms from John W. Layman, Jun 24 2005
STATUS
approved