Nim is a game where counters are removed from a number of piles so that the player who takes the last counter wins (or loses depending on the rules).

The number and size of the starting piles can vary, after which players alternately take any desired number of counters from one pile only at each turn.

To play Nim use: http://demonstrations.wolfram.com/TheGameOfNim/

The perfect winning strategy for Nim has been found and depends on calculting the binary digital sum (equivalent to finding powers of 2) and with practice, can be performed mentally fairly quickly.

The strategy can be found at: http://en.wikipedia.org/wiki/Nim