Problem 550
Divisor game
Two players are playing a game. There are k piles of stones. When it is his turn a player has to choose a pile and replace it by two piles of stones under the following two conditions:
- Both new piles must have a number of stones more than one and less than the number of stones of the original pile.
- The number of stones of each of the new piles must be a divisor of the number of stones of the original pile.
The first player unable to make a valid move loses.
Let f(n,k) be the number of winning positions for the first player, assuming perfect play, when the game is played with k piles each having between 2 and n stones (inclusively).f(10,5)=40085.
Find f(107,1012).Give your answer modulo 987654321.
约数游戏
两位玩家正在玩一个游戏:一开始,一共有k堆石子;每位玩家在轮到自己时,根据以下两个条件,选择一个堆,并将其换成两堆石子:
- 新的两堆石子的数目必须大于1且小于原来那一堆石子的数目;
- 新的两堆石子的数目必须是原来那一堆石子的数目的约数。
首先无法进行操作的玩家落败。
如果游戏一开始有k个堆,每堆石子的数目在2至n之间(含),记所有可能的游戏初始局面中先手玩家必胜的局面数为f(n,k)。已知f(10,5)=40085。
求f(107,1012),将你的答案对987654321取余。