A position in Nim consists of some piles of coins. Two players alternate, with each move removing a portion of one pile. The winner is the player who takes the last coin.
Suppose that the starting piles have size $n_1,...,n_k$. Prove that Player 2 has a winning startegy if and only if for every $j$, an even number of $n_1,...,n_k$ have a $1$ in position $j$ in their binary representation. For example, when the sizes are $1,2,3$, the binary representation are $1, 10, 11,$ and the condition holds.