# A combinatorial game about stones

There are some piles of stones.

Two players move in turn. One can remove a stone from a pile or merge two piles in a move. The player that removes the last stone wins.

With the number of stones in each pile given, how to know who will win?

• In fact, I got a conclusion, but I don't know how to prove it. Suppose there are $p$ piles, $k$ piles that contain only one stone, and a total of $n$ stones. If $n \le p+1$, the first player lose when $k\bmod{3}=0$. If $n>p+1$ the first player lose when $p+n$ is odd and $k$ is even. – Tang Xianghao Jul 6 '13 at 12:31