# A nim-game variant

Suppose a bucket contains n balls. In each turn one removes some balls k from the basket. If first player removes even-number balls then second player must removes odd-number of balls and vice-versa. The winner is who plays the last turn and makes the bucket empty. The game is tie when it is impossible to make the bucket empty. Assume both players play optimally. Here optimally means a player plays in a way so that the opponent player does not win. 0

• Does the first person have to do the opposite of what the second player did? In that case all the first player's moves have one parity and all the second player's moves have another. This is not necessarily nim, as the moves available to each player are different. Why doesn't the first player take all the balls and win? Jun 19, 2014 at 3:34
• What exactly is your question? Are you looking for the values of the games, just the winner, an optimal strategy, $\ldots$? Jun 19, 2014 at 3:40
• I want to know the winner along with optimal strategy given different values of n Jun 19, 2014 at 3:42

Hint: think first about what happens when $n$ is odd. The strategy is rather simple then. There is no reason that $n$ is limited to small numbers. You can compute the winner in one line.