|
|
A295896
|
|
a(n) = 1 if there are no odd runs of 1's in the binary expansion of n followed by a 0 to their right, 0 otherwise.
|
|
6
|
|
|
1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0
|
|
LINKS
|
|
|
FORMULA
|
a(0) = 1; and then after, for odd n, a(n) = a((n-1)/2), for even n, a(n) = 0 if A007814(1+(n/2)) is odd, otherwise a(n/2).
|
|
EXAMPLE
|
Drawing the terms as a binary tree (the first six levels shown) helps in seeing where terms of A028982 (squares and twice squares) are located in Doudna-tree (A005940, at the positions where 1's occur here):
1
|
1
............../ \..............
0 1
....../ \...... ....../ \......
0 0 1 1
/ \ / \ / \ / \
/ \ / \ / \ / \
0 0 0 0 1 1 0 1
/ \ / \ / \ / \ / \ / \ / \ / \
0 0 0 0 0 0 0 0 1 1 0 1 0 0 1 1
|
|
MATHEMATICA
|
Array[Boole@ NoneTrue[Partition[PadRight[#, # + Boole[OddQ@ #] &@ Length@ #, ""] /. _?StringQ -> {0, 0}, 2, 2][[All, All, -1]] &@ Map[{First@ #, Length@ #} &, Split@ IntegerDigits[#, 2]], And[OddQ@ #1, #2 > 0] & @@ # &] &, 120, 0] (* Michael De Vlieger, Dec 02 2017 *)
|
|
PROG
|
(Scheme, with memoization-macro definec)
|
|
CROSSREFS
|
Characteristic function of A295897.
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|