In number theory, the nth Pisano period, written π(n), is the period with which the sequence of Fibonacci numbers taken modulo n repeats. Pisano periods are named after Leonardo Pisano, better known as Fibonacci. The existence of periodic functions in Fibonacci numbers was noted by Joseph Louis Lagrange in 1774.
The Fibonacci numbers are the numbers in the integer sequence:
defined by the recurrence relation
For any integer n, the sequence of Fibonacci numbers Fi taken modulo n is periodic. The Pisano period, denoted π(n), is the length of the period of this sequence. For example, the sequence of Fibonacci numbers modulo 3 begins:
This sequence has period 8, so π(3) = 8.
With the exception of π(2) = 3, the Pisano period π(n) is always even. A simple proof of this can be given by observing that π(n) is equal to the order of the Fibonacci matrix
in the general linear group GL2(ℤn) of invertible 2 by 2 matrices in the finite ring ℤn of integers modulo n. Since F has determinant -1, the determinant of Fπ(n) is (-1)π(n), and since this must = 1 in ℤn, either n≤2 or π(n) is even.
If m and n are coprime, then π(mn) is the least common multiple of π(m) and π(n), by the Chinese remainder theorem. For example, π(3) = 8 and π(4) = 6 imply π(12) = 24. Thus the study of Pisano periods may be reduced to that of Pisano periods of prime powers q = pk, for k ≥ 1.