|
| |
|
|
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
|
|
|
REFERENCES
|
J.-P. Allouche and J. Shallit, Automatic Sequences, Cambridge Univ. Press, 2003, p. 157.
J. Winter, M. M. Bonsangue and J. J. M. M. Rutten, Context-free coalgebras, 2013; http://oai.cwi.nl/oai/asset/21313/21313A.pdf
|
|
|
LINKS
|
Table of n, a(n) for n=0..104.
Eric Weisstein's World of Mathematics, Baum-Sweet Sequence
Wikipedia, Baum-Sweet Sequence
|
|
|
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)
|
|
|
CROSSREFS
|
Cf. A037011.
Sequence in context: A141736 A134842 A167753 * A141727 A123594 A145006
Adjacent sequences: A086744 A086745 A086746 * A086748 A086749 A086750
|
|
|
KEYWORD
|
nonn,easy,changed
|
|
|
AUTHOR
|
N. J. A. Sloane, Sep 12 2003
|
|
|
EXTENSIONS
|
More terms from Ray Chandler, Sep 14 2003
|
|
|
STATUS
|
approved
|
| |
|
|