%I #16 Mar 09 2023 13:18:24
%S 0,0,0,0,0,1,0,0,0,1,0,1,0,4,0,0,0,1,0,1,0,4,0,1,0,4,0,4,0,13,0,0,0,1,
%T 0,1,0,4,0,1,0,4,0,4,0,13,0,1,0,4,0,4,0,13,0,4,0,13,0,13,0,40,0,0,0,1,
%U 0,1,0,4,0,1,0,4,0,4,0,13,0,1,0,4,0,4,0,13,0,4,0,13,0,13,0,40,0,1,0,4,0,4,0
%N a(n) = the number of unordered triples of integers (a,b,c) with a+b+c=n, whose bitwise XOR is zero. Equivalently, the number of three-heap nim games with n stones which are in a losing position for the first player.
%C The following sequences all appear to have the same parity: A003071, A029886, A061297, A092524, A093431, A102393, A104258, A122248, A128975. - Jeremy Gardiner, Dec 28 2008
%H Antti Karttunen, <a href="/A128975/b128975.txt">Table of n, a(n) for n = 1..65537</a>
%H Tanya Khovanova, <a href="http://arxiv.org/abs/1410.2193">There are no coincidences</a>, arXiv preprint 1410.2193 [math.CO], 2014.
%F a(n)=0 if n is odd; otherwise, a(n) = ( 3^(r-1) - 1)/2, where r is the number of 1's in the binary expansion of n.
%e For example, a(14)=4; the four 3-tuples are (1,6,7), (2,5,7), (3,4,7) and (3,5,6).
%o (PARI) A128975(n) = if(n%2,0,(1/2)*((3^(hammingweight(n)-1))-1)); \\ _Antti Karttunen_, Sep 25 2018
%Y Cf. A000120, A003987.
%K easy,nonn
%O 1,14
%A _Jacob A. Siehler_, Apr 29 2007