|
|
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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
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))
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|