Baum–Sweet sequence

In mathematics the Baum–Sweet sequence is an infinite automatic sequence of 0s and 1s defined by the rule:

bn = 1 if the binary representation of n contains no block of consecutive 0s of odd length;
bn = 0 otherwise;

for n ≥ 0.

For example, b4 = 1 because the binary representation of 4 is 100, which only contains one block of consecutive 0s of length 2; whereas b5 = 0 because the binary representation of 5 is 101, which contains a block of consecutive 0s of length 1.

Starting at n = 0, the first few terms of the Baum–Sweet sequence are:

1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1 ... (sequence A086747 in the OEIS)