854. Pisano Periods 2

For every positive integer n the Fibonacci sequence modulo n is periodic. The period depends on the value of n. This period is called the Pisano period for n, often shortened to π(n).

Define M(p) as the largest integer n such that π(n)=p, and define M(p)=1 if there is no such n.
For example, there are three values of n for which π(n) equals 18: 19,38,76. Therefore M(18)=76.

Let the product function P(n) be:

P(n)=p=1nM(p).

You are given: P(10)=264.

Find P(1000000)mod1234567891.

854. 皮萨诺周期 2

对诸正整数 n,斐波那契数列每项模 n 产生的新数列必是周期数列。这个周期与 n 有关,我们称其为 n皮萨诺周期,常简记为 π(n)

M(p) 为满足 π(n)=p 的最大的整数 n,若不存在满足条件的正整数,则令 M(p)=1
例如,共有 3 个满足 π(n)=18 的正整数,分别是 19,38,76。故 M(18)=76

M(p) 的前缀积是 P(n)

P(n)=p=1nM(p).

已知 P(10)=264

P(1000000)mod1234567891


这个链接 回到源站。

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