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?

  • $\begingroup$ 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?"? $\endgroup$ Jul 11, 2017 at 6:40
  • $\begingroup$ Determinate the winning position, for example $\endgroup$
    – Dattier
    Jul 11, 2017 at 6:50

1 Answer 1


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.

  • $\begingroup$ how about other prime number rather than 5? such as 7k+1? $\endgroup$
    – Oray
    Jul 11, 2017 at 6:53
  • $\begingroup$ @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. $\endgroup$
    – ffao
    Jul 11, 2017 at 6:54
  • $\begingroup$ my misunderstanding the question :) thanks for reply. $\endgroup$
    – Oray
    Jul 11, 2017 at 6:55
  • $\begingroup$ Power of 2 or of 3 like (1,2,3,4,8,9,16,...) $\endgroup$
    – Dattier
    Jul 11, 2017 at 6:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.