Given $k, n > 0$, how many ordered lists $a_1, a_2, \dots, a_k$ are there such that $a_i \geq 0$ for all $i$, such that $\sum_i a_i = n$ and $\oplus_i a_i = 0$, where the latter operation denotes bitwise xor (i.e. $15 \oplus 3 = 12$).
It is likely there is no closed-form expression, in that case a reasonably fast algorithm would also be interesting.
EDIT: Context: this is the number of losing starting positions in a game of Nim with $k$ initial piles containing a total of $n$ stones.