Two players, and alternatively take stones from a pile of stones. plays first and in his first move he must take at least one stone and at most stones. Then each player must take at least one stone and at most as many stones as his opponent took in the previous move. The player who takes the last stone wins. Which player has a winning strategy?
Problem 1562
Official solution
1. Initial Setup and Definitions:
- Let be the number of stones in the pile.
- Player starts and must take between 1 and stones.
- Each subsequent player must take at least one stone and at most as many stones as the opponent took in the previous move.
- The player who takes the last stone wins.
2. Winning Strategy Analysis:
- We need to determine which player has a winning strategy based on the value of .
3. **Case 1: is a power of 2**:
- Suppose for some integer .
- Player must take between 1 and stones.
- No matter how many stones takes, the remaining number of stones will not be a power of 2.
- Player can always respond by taking a number of stones such that the remaining number of stones is a power of 2.
- This ensures that Player can always force the game back to a power of 2 situation after each of 's moves.
- Therefore, Player has a winning strategy when is a power of 2.
4. **Case 2: is not a power of 2**:
- Suppose is not a power of 2.
- Player can take a number of stones such that the remaining number of stones is a power of 2.
- For example, if , Player can take 5 stones, leaving 8 stones (which is ).
- This forces Player into the situation described in Case 1, where is a power of 2.
- Player can always make the first move to reduce the pile to a power of 2, ensuring that Player is always the one to face the power of 2 situation.
- Therefore, Player has a winning strategy when is not a power of 2.
5. General Strategy:
- A position is a winning position if and only if the highest number of stones your opponent last took (the number you may take this turn) is at least as many as the highest power of 2 dividing your number.
- The winning strategy is to remove enough stones to leave a number of stones divisible by more times than any number between it and the number you started with.
- For example, if your opponent had 13 stones and removed 6 to give 7, a winning move is to take away either 1 or 3 to get to 6 or 4.
6. Proof of Strategy:
- Suppose you are at and you are allowed to take .
- Then you take stones to leave you at , which has a higher power of 2 than does.
- On the other hand, if you are at and you are only allowed to take , then you cannot raise the power of 2 by taking away stones.
- The positions you can win from are if you have stones left and you are allowed to take or more; this is certainly a winning position since no power of 2 dividing can be bigger than itself.
The final answer is: If is a power of 2, then Player wins. Otherwise, Player wins.