Two players play a game starting with a pile of \(n\) stones. The players take turns removing stones from the pile. On their turn they are allowed to remove 1 stone from the pile, 2 stones from the pile, or half the stones from the pile, provided the number of stones in the pile is even. The player who wins is the player who makes the last move (i.e. removes the last stone). If the values of \(n\) can be any number from 1 to 500 (inclusive), determine for how many of these games the first player can win the game if he plays optimally.

**Details and assumptions**

If the number of stones is odd, then the player can only remove 1 stone from the pile or 2 stones from the pile.

×

Problem Loading...

Note Loading...

Set Loading...