PROJECT EULER · #0692
Siegbert and Jo
Siegbert and Jo take turns playing a game with a heap of
1. Siegbert is the first to take some pebbles. He can take as many pebbles as he wants. (Between 1 and
2. In each of the following turns the current player must take at least one pebble and at most twice the amount of pebbles taken by the previous player.
3. The player who takes the last pebble wins.
Although Siegbert can always win by taking all the pebbles on his first turn, to make the game more interesting he chooses to take the smallest number of pebbles that guarantees he will still win (assuming both Siegbert and Jo play optimally for the rest of the game).
Let
Let
Find
Write-up coming later
The complete problem is available here. An approach, code, and answer will be added later.