0%

Problem 728


Problem 728


Circle of Coins

Consider n coins arranged in a circle where each coin shows heads or tails. A move consists of turning over k consecutive coins: tail-head or head-tail. Using a sequence of these moves the objective is to get all the coins showing heads.

Consider the example, shown below, where n=8 and k=3 and the initial state is one coin showing tails (black). The example shows a solution for this state.

For given values of n and k not all states are solvable. Let F(n,k) be the number of states that are solvable. You are given that F(3,2)=4, F(8,3)=256 and F(9,3)=128.

Further define:
S(N)=n=1Nk=1nF(n,k)

You are also given that S(3)=22, S(10)=10444 and S(103)853837042(mod1 000 000 007).

Find S(107). Give your answer modulo 1 000 000 007.


硬币圈

n枚硬币摆成一圈,初始状态下硬币任意地正面或反面朝上。每一次行动可以将相邻的k枚硬币翻面:正面变为反面,反面变为正面。最终目标是通过一系列行动将所有的硬币翻为正面朝上。

考虑如下所示这个例子,其中n=8k=3,初始状态下只有一枚硬币为反面(用黑色表示)。下图展示了其中一种将初始状态变为全正面朝上的解法。

对于给定的nk的取值,不是所有的初始状态都能够完成目标。记F(n,k)为所有能够完成目标的初始状态数目。已知F(3,2)=4F(8,3)=256F(9,3)=128

进一步地,记
S(N)=n=1Nk=1nF(n,k)

已知S(3)=22S(10)=10444S(103)853837042(mod1 000 000 007)

S(107),并将你的答案对1 000 000 007取余。


Gitalking ...