# Nim Games: Is it possible to reduce following using Grundy Number?

Following is the problem from a finished programming contest.

Two players try to create a number, DesiredTotal, by adding numbers from 1 to N. The first to cross the number is the winner. The number to be added cannot be repeated. For example, if one player used 4 to increase the sum from 20 to 24, the neither player can use 4 again in the game.

Now I understand how the above problem could be solved using dynamic programming by exploring all the possible paths and memoizing the solution, but the game being impartial still qualifies to be a Nim game.

Am I correct that, it is a Nim game? If yes, could somebody help me to reduce into a Nim game?

Below is the source but it requires signing in.

• I'm not sure what you mean by "A nim game." Could you define this class of games? Nov 26, 2016 at 11:29
• Nov 26, 2016 at 12:21
• Why the negative vote? It is a finished contest and I am trying to grasp the theory on Nim games by practising some questions? Nov 27, 2016 at 9:56
• Your example is not formulated very well. It seems that once 4 is used, neither player can use it again. Nov 28, 2016 at 22:15
• Sources which aren't accessible aren't useful. Nov 28, 2016 at 22:15