Problem definition
The Pisano period of a prime p, is defined as the minimum integer π(p) satisfying f0≡fπ(p),f1≡fπ(p)+1(modp), where f is the Fibonacci sequence. It is well known that for p=2,5, π(p) is either a divisor of p−1 or 2p+2. In this article, we extend this conclusion to any C-finite sequence of the formulae fn≡afn−1+fn−2(modp), where a∈Zp is a constant.
Assume fn has a general form rn. Then we rewrite the recursive formulae as rn≡arn−1+rn−2, which yields a characteristic equation r2−ar−1≡0. Let λ1,λ2 be the characteristic roots. Assume f0=0,f1=1, W.L.O.G., We claim that:
fn≡λ1−λ2λ1n−λ2n
Proof: since fn−1≡λ1−λ2λ1n−1−λ2n−1 and fn−2≡λ1−λ2λ1n−2−λ2n−2,
afn−1+fn−2≡λ1−λ2aλ1n−1−aλ2n−1+λ1n−2−λ2n−2≡λ1−λ2λ1n−2(aλ1+1)−λ2n−2(aλ2+1)≡λ1−λ2λ1n−λ2n≡fn
Pisano period
As aforementioned, the characteristic roots should satisfy r2−ar−1≡0 or (2r−a)2≡a2+4(modp). If ∃w∈Zp such that w2≡a2+4(modp), it is straightforward to derive 2λ1−a≡w and 2λ2−a≡−w and thus λ1,λ2∈Zp. Then by Fermat’s little theorem, λ1p−1≡λ2p−1≡1 and:
fn+p−1≡λ1−λ2λ1n+p−1−λ2n+p−1≡λ1−λ2λ1n−λ2n≡fn
which implies that the Pisano period π(p)∣(p−1).
If ∃w∈Zp such that w2≡a2+4(modp), we claim that π(p)∣(2p+2).
Proof: since λ1,λ2 are the roots of the equation r2−ar−1≡0, λ1+λ2≡a and λ1λ2≡−1.
(λ1+λ2)p≡λ1p+λ2p≡ap
Let w=2λ1−a. Then:
(w+a)p2−p+λ2p≡ap
Note that λ1,λ2,w∈Zp and 2,a∈Zp. Therefore, (2−1)p−1≡ap−1≡1 by Fermeat’s little theorem:
(w+a)p+2λ2p≡2ap⇒wp+2λ2p≡ap≡a⇒λ2p≡2−1(a−wp)
By quadratic reciprocity, wp−1≡(a2+4)2p−1≡−1, then:
λ2p≡2−1(a+w)≡λ1
Then λ2p+1≡λ1λ2≡−1 and λ22p+2≡1. Similarly, we can prove λ12p+2≡1 by assuming w=2λ2−a. Therefore:
fn+2p+2≡λ1−λ2λ1n+2p+2−λ2n+2p+2≡λ1−λ2λ1n−λ2n≡fn