The Pisano period of C-finite sequences

Problem definition

The Pisano period of a prime , is defined as the minimum integer satisfying , where is the Fibonacci sequence. It is well known that for , is either a divisor of or . In this article, we extend this conclusion to any C-finite sequence of the formulae , where is a constant.

Closed form expression

Assume has a general form . Then we rewrite the recursive formulae as , which yields a characteristic equation . Let be the characteristic roots. Assume , W.L.O.G., We claim that:

Proof: since and ,

Pisano period

As aforementioned, the characteristic roots should satisfy or . If such that , it is straightforward to derive and and thus . Then by Fermat’s little theorem, and:

which implies that the Pisano period .

If such that , we claim that .

Proof: since are the roots of the equation , and .

Let . Then:

Note that and . Therefore, by Fermeat’s little theorem:

By quadratic reciprocity, , then:

Then and . Similarly, we can prove by assuming . Therefore: