947. Fibonacci Residues

The (a,b,m)-sequence, where 0≤a,b<m, is defined as

g(0)=ag(1)=bg(n)=(g(n−1)+g(n−2))modm

All (a,b,m)-sequences are periodic with period denoted by p(a,b,m).
The first few terms of the (0,1,8)-sequence are (0,1,1,2,3,5,0,5,5,2,7,1,0,1,1,2,…) and so p(0,1,8)=12.

Let s(m)=∑a=0m−1∑b=0m−1p(a,b,m)2. For example, s(3)=513 and s(10)=225820.

Define S(M)=∑m=1Ms(m). You are given, S(3)=542 and S(10)=310897.

Find S(106). Give your answer modulo 999999893.

947. 斐波那契余数

对满足 0≤a,b<m 的整数 a,b,m,定义 (a,b,m)-序列如下:

g(0)=ag(1)=bg(n)=(g(n−1)+g(n−2))modm

所有 (a,b,m)-序列都是周期数列,记其周期为 p(a,b,m)。例如,(0,1,8)-序列的前若干项是 (0,1,1,2,3,5,0,5,5,2,7,1,0,1,1,2,…),于是 p(0,1,8)=12。

记 s(m)=∑a=0m−1∑b=0m−1p(a,b,m)2,例如,s(3)=513、s(10)=225820。

记 S(M)=∑m=1Ms(m)。已知 S(3)=542、S(10)=310897。

求 S(106) 模 999999893 的值。


点 这个链接 回到源站。

点 这个链接 回到详细版题目目录。