Game of NIM

Two people play a game of NIM. There are 100 matches on a table, and the players take turns picking 1 to 5 sticks at a time. The person who takes the last stick wins the game. Who has a winning strategy?

The first person has a winning strategy. First, he takes 4 sticks. Then every time the second player takes X sticks, the first player takes 6 – X sticks.

We do not know where this puzzle originated from. If you have any information, please let us know via email.


    1. Hi Uttej! The idea is that if the person takes 4 sticks first, then there are 96 sticks remaining, which is divisible by 6. Now, if the first person keeps taking 6 – X sticks every time the second person takes X sticks, then the number of sticks will keep decreasing by 6. Therefore, you will get 100 -> 96 -> (96 – X) -> 90 -> (90 -X) -> 84 -> … -> 6 -> (6 – X) -> 0.