Proportionate Nim
Problem 665
Two players play a game with two piles of stones.
On his or her turn, a player chooses a positive integer and does one of the following:
The player who removes the last stone wins.
We denote by the position in which the piles have and stones remaining. Note that is considered to be the same position as .
Then, for example, if the position is , the next player may reach the following positions:
, , , , , , , , , , ,
, , , , , , , , , , ,
A position is a losing position if the player to move next cannot force a win. For example, , , are the first few losing positions.
Let be the sum of for all losing positions with and . For example, , by considering the losing positions , , .
You are given that and .
Find .