login
This site is supported by donations to The OEIS Foundation.

 

Logo

Many excellent designs for a new banner were submitted. We will use the best of them in rotation.

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A086747 Baum-Sweet sequence: a(n) = 1 if binary representation of n contains no block of consecutive zeros of odd length; otherwise a(n) = 0. 8
1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,1

COMMENTS

It appears that the positions of 1's are given by sequence A060142. - R. J. Mathar, Apr 19 2013

This follows the definition of the sequence: 4x appends an even number of zeros, while 2x+1 appends a 1. - Charles R Greathouse IV, Oct 21 2013

REFERENCES

J.-P. Allouche and J. Shallit, Automatic Sequences, Cambridge Univ. Press, 2003, p. 157.

LINKS

Table of n, a(n) for n=0..104.

Eric Weisstein's World of Mathematics, Baum-Sweet Sequence

Wikipedia, Baum-Sweet Sequence

J. Winter, M. M. Bonsangue and J. J. M. M. Rutten, Context-free coalgebras, 2013.

MAPLE

isNotA086747 := proc(n)

    local csl, b, i ;

    csl := 0 ;

    b := convert(n, base, 2) ;

    for i from 1 to nops(b) do

        if op(i, b) = 1 then

            if type(csl, 'odd') then

                return true ;

            end if;

            csl := 0 ;

        else

            csl := csl+1 ;

        end if;

    end do:

    type(csl, 'odd') ;

end proc:

A086747 := proc(n)

    if isNotA086747(n) then

        0;

    else

        1;

    end if;

end proc: # R. J. Mathar, Apr 19 2013

MATHEMATICA

Contribution from Robert G. Wilson v, May 03 2010: (Start)

a[n_] := Block[{b = Plus @@ Union@ Mod[ Length@# & /@ Select[ Union@ Split@ IntegerDigits[n, 2], MemberQ[ #, 0] &], 2]}, If[b == 0, 1, 0]]; a[0] = 1; Table[a@n, {n, 0, 104}]

(* Or *) a[0] = 1; a[1] = 1; a[n_] := a[n] = Block[{k = n}, While[ Mod[k, 4] == 0, k /= 4]; If[ OddQ@k, a[(k - 1)/2], 0]]; Table[a@n, {n, 0, 104}]

(* Or *) Nest[Partition[ Flatten[ # /. {{0, 0} -> {0, 0, 0, 0}, {0, 1} -> {1, 0, 0, 1}, {1, 0} -> {0, 1, 0, 0}, {1, 1} -> {1, 1, 0, 1}}], 2] &, {1, 1}, 6] // Flatten (End)

PROG

(PARI) a(n)=if(n<3, n<2, if(n%2, a(n\2), n%4==0&&a(n/4))) \\ Charles R Greathouse IV, Oct 21 2013

CROSSREFS

Cf. A037011.

Sequence in context: A141736 A134842 A167753 * A141727 A123594 A145006

Adjacent sequences:  A086744 A086745 A086746 * A086748 A086749 A086750

KEYWORD

nonn,easy

AUTHOR

N. J. A. Sloane, Sep 12 2003

EXTENSIONS

More terms from Ray Chandler, Sep 14 2003

STATUS

approved

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

Content is available under The OEIS End-User License Agreement .

Last modified April 24 04:54 EDT 2014. Contains 240947 sequences.