login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A108737
Start with S = {}. For m = 0, 1, 2, 3, ... let u be the binary expansion of m. If u is not a substring of S, append the minimal number of 0's and 1's to S to remedy this. Sequence gives S.
6
0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1
OFFSET
1,1
LINKS
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
Cf. A108736.
Sequence in context: A189203 A296028 A165263 * A165221 A295891 A093879
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, Jun 23 2005
EXTENSIONS
More terms from John W. Layman, Jun 24 2005
STATUS
approved