login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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

%I #10 Oct 27 2023 13:09:56

%S 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,

%T 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,

%U 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

%N 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.

%H Michael S. Branicky, <a href="/A108737/b108737.txt">Table of n, a(n) for n = 1..10000</a>

%e We construct S as follows, starting with S = {}.

%e 0 is missing, so S = {0};

%e 1 is missing, so S = {0,1};

%e 10 is missing, so S = {0,1,0};

%e 11 is missing, so S = {0,1,0,1,1};

%e 100 is missing, so S = {0,1,0,1,1,0,0};

%e 101 and 110 are visible, but 111 is missing, so S = {0,1,0,1,1,0,0,1,1,1}; etc.

%o (Python)

%o from itertools import count, islice, product

%o def a(): # generator of terms

%o S = ""

%o for m in count(0):

%o Sm = bin(m)[2:]

%o if Sm in S: continue

%o for i in range(1, len(Sm)+1):

%o v = Sm[-i:]

%o t = "" if len(v) == len(Sm) else S[-len(Sm)+i:]

%o if t+v == Sm: break

%o S += v

%o yield from list(map(int, v))

%o print(list(islice(a(), 105))) # _Michael S. Branicky_, Oct 27 2023

%Y Cf. A108736.

%K nonn,easy

%O 1,1

%A _N. J. A. Sloane_, Jun 23 2005

%E More terms from _John W. Layman_, Jun 24 2005

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 09:07 EDT 2024. Contains 371964 sequences. (Running on oeis4.)