PROJECT EULER · #0665
Proportionate Nim
Two players play a game with two piles of stones, alternating turns.
On each turn, the corresponding player chooses a positive integer
- removes
stones from one pile; - removes
stones from both piles; or - removes
stones from one pile and stones from the other pile.
The player who removes the last stone wins.
We denote by
Then, for example, if the position is
A position is a losing position if the player to move next cannot force a win. For example,
Let
You are given that
Find
Write-up coming later
The complete problem is available here. An approach, code, and answer will be added later.