Bézout’s Game
Two players play a game with two piles of stones. They take alternating turns. If there are currently stones in the first pile and stones in the second, a turn consists of removing stones from the first pile and from the second in such a way that . The winner is the player who first empties one of the piles.
Note that the game is only playable if the sizes of the two piles are coprime.
A game state is a winning position if the next player can guarantee a win with optimal play. Define to be the number of winning positions with , , and . Note the order matters, so for example and are distinct positions.
You are given and .
Find .
裴蜀游戏
两名玩家正在用两堆石子玩游戏。他们轮流行动,若当前第一堆有枚石子而第二堆有枚,则这一轮的玩家可以从第一堆移除枚石子并从第二堆移除枚石子且满足。首先将其中一堆石子清空的玩家获胜。
注意这个游戏只有在两堆石子的数目互质时才能进行。
若玩家面对游戏状态时按照最优策略必定获胜,则称该游戏状态为必胜态。记为满足,,和的必胜态的数目。在计算数目时需要注意顺序,例如和应视为不同的游戏状态。
已知和。
求。
Gitalking ...