OFFSET
0
LINKS
FORMULA
EXAMPLE
The first six levels of the binary tree (compare also to the illustrations given at A005940, A295894, A295895):
0
|
1
............../ \..............
0 1
....../ \...... ....../ \......
1 0 1 1
/ \ / \ / \ / \
/ \ / \ / \ / \
0 1 1 0 0 0 0 0
/ \ / \ / \ / \ / \ / \ / \ / \
0 1 0 0 1 0 0 0 0 1 0 0 0 1 0 1
For n=0, the corresponding node in A005940(0+1) is 1, which has just one child 2, thus we set a(0) = 0 by convention.
For n=1, the corresponding node in A005940(1+1) is 2, which has 3 as its left-hand child, and in binary 2 is "10", and 3 is "11", so the other one has an odd number of 1-bits, while the other has an even number of 1's, thus their parities differ and a(1) = 1.
For n=2, the corresponding node in A005940(1+2) is 3 (in binary "11"), which has 5 (in binary "101") as its left-hand child, and they have the same parity, thus a(2) = 0.
For n=3, the corresponding node in A005940(1+3) is 4 (in binary "100"), which has 9 (in binary "1001") as its left hand child, and here the parities differ, thus a(3) = 1.
CROSSREFS
KEYWORD
nonn,tabf
AUTHOR
Antti Karttunen, Nov 30 2017
STATUS
approved