← RoseCode

ROSECODE 239

Generalized Pisano Period 1

Min_25 · Math ·

Let Fk(n) be a linear recurrence sequence such that Fk(n)=1 (1nk),Fk(n)=i=1kFk(ni) (n>k).

For example, F2(1)=1, F2(2)=1 and F2(3)=2

Let P(k,m) be the (minimum) period of Fk(n) modulo m.

You are given that P(2,10)=60 and P(2,109)=1 500 000 000.

Find P(10,109).

[My timing: instant]