Alice and Bob are playing a variant of Nim game. There are $n$ piles consisting of $a, b, c,\cdots$ coins respectively. On a move, a player can remove a square number of coins from either pile; e.g. one can remove $1,4,9,\cdots$ coins from either pile in one move. Empty moves are not allowed. The player unable to move loses. Suppose Alice goes first. Determine the condition that Alice wins, as well as devise a winning strategy for him. Assume both players play optimally.
Here are my efforts:
Define a set $G_n$ consisting of all possible partitions of a number $n$ into squares. For example, $$G_6 = \{1+1+1+1+1+1, \ 4+1+1\}$$ Now, note that if the total number of moves (till all piles become zero) is odd, Alice wins; if it is odd, Bob wins.
Now, if there is only one pile, then the pile may approach zero in some order, say $P$, then $P\in G$ by definition of $G$. Let us say the total number of numbers in a path $P$ will be $n(P)$. In a one-pile game, Alice wins if $n(P)$ is odd, else Bob wins.
Similarly, in a $n$-pile game, Alice wins if the sum of the values of $n(P)$ for each pile is odd, else Bob wins.
Now, in a one-pile game, Alice's strategy should be to choose that $P\in G$ that has the largest numbers, because if he chooses smaller numbers, Bob can break his path.
But I'm unable to figure out a strategy for him where $n> 1$. Can anyone help me out?