# The game of pebbles +

The game of pebbles is a two-player game. The game starts with N stones. On a player's turn, he or she must remove either 1, a power of 2 (2,4,8,...) or a power of 3 stones (3,9,27,...). The player who does not take the last stone is the winner.

Is there a winning strategy?

• There is for some values of N and there isn't for others. Did you mean to ask "for which values of N is there a winning strategy?"? Jul 11, 2017 at 6:40
• Determinate the winning position, for example Jul 11, 2017 at 6:50

The losing positions for the first player are those for which

The number of stones N is one more than a multiple of 5, that is, of the form $N = 5k+1$.

The reason for this:

Note that the players always have the option to remove 1,2,3 or 4 stones. However, they can't remove 5 or a multiple of 5. So whatever move the first player makes in one of the positions of the form $5k+1$, the second player can make a move that brings the first player back to one more than a multiple of 5, until they reach 1 stone and the first player is forced to take it.

• how about other prime number rather than 5? such as 7k+1?
– Oray
Jul 11, 2017 at 6:53
• @Oray taking 5 or 6 isn't allowed, so you can't guarantee that the second player can always bring the game back to 7k+1.
– ffao
Jul 11, 2017 at 6:54
• my misunderstanding the question :) thanks for reply.
– Oray
Jul 11, 2017 at 6:55
• Power of 2 or of 3 like (1,2,3,4,8,9,16,...) Jul 11, 2017 at 6:56