Pisano period
In number theory, the nth Pisano period, written , 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.
Definition
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 ', 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 ' = 8.
Properties
With the exception of ' = 3, the Pisano period ' is always even.A simple proof of this can be given by observing that ' is equal to the order of the Fibonacci matrix.
in the general linear group GL2 of invertible 2 by 2 matrices in the finite ring ℤn of integers modulo n. Since Q has determinant −1, the determinant of Q' is ', and since this must equal 1 in ℤn, either n ≤ 2 or ' is even.
If m and n are coprime, then ' is the least common multiple of ' and ', by the Chinese remainder theorem. For example, ' = 8 and ' = 6 imply ' = 24. Thus the study of Pisano periods may be reduced to that of Pisano periods of prime powers q = pk, for k ≥ 1.
If p is prime, ' divides pk–1 '. It is conjectured that
for every prime p and integer k > 1. Any prime p providing a counterexample would necessarily be a Wall-Sun-Sun prime, and such primes are also conjectured not to exist.
So the study of Pisano periods may be further reduced to that of Pisano periods of primes. In this regard, two primes are anomalous. The prime 2 has an odd Pisano period, and the prime 5 has period that is relatively much larger than the Pisano period of any other prime. The periods of powers of these primes are as follows:
- If n = 2k, then ' = 3·2k–1 = =.
- if n = 5k, then ' = 20·5k–1 = = 4n.
The remaining primes all lie in the residue classes or. If p is a prime different from 2 and 5, then the modulo p analogue of Binet's formula implies that ' is the multiplicative order of the roots of modulo p. If, these roots belong to . Thus their order, ' is a divisor of p − 1. For example, ' = 11 − 1 = 10 and ' = /2 = 14.
If the roots modulo p of do not belong to , and belong to the finite field
As the Frobenius automorphism exchanges these roots, it follows that, denoting them by r and s, we have r p = s, and thus r p+1 = –1. That is r 2 = 1, and the Pisano period, which is the order of r, is the quotient of 2 by an odd divisor. This quotient is always a multiple of 4. The first examples of such a p, for which ' is smaller than 2, are ' = 2/3 = 32, ' = 2/3 = 72 and ' = 2/3 = 76.
It follows from above results, that if n = pk is an odd prime power such that ' > n, then '/4 is an integer that is not greater than n. The multiplicative property of Pisano periods imply thus that
The first examples are ' = 60 and ' = 300. If n is not of the form 2 · 5r, then ' ≤ 4n.
Tables
The first twelve Pisano periods and their cycles are:n | π | number of zeros in the cycle | cycle | OEIS sequence for the cycle |
1 | 1 | 1 | 0 | |
2 | 3 | 1 | 011 | |
3 | 8 | 2 | 0112 0221 | |
4 | 6 | 1 | 011231 | |
5 | 20 | 4 | 01123 03314 04432 02241 | |
6 | 24 | 2 | 011235213415 055431453251 | |
7 | 16 | 2 | 01123516 06654261 | |
8 | 12 | 2 | 011235 055271 | |
9 | 24 | 2 | 011235843718 088764156281 | |
10 | 60 | 4 | 011235831459437 077415617853819 099875279651673 033695493257291 | |
11 | 10 | 1 | 01123582A1 | |
12 | 24 | 2 | 011235819A75 055A314592B1 |
The first 144 Pisano periods are shown in the following table:
π | +1 | +2 | +3 | +4 | +5 | +6 | +7 | +8 | +9 | +10 | +11 | +12 |
0+ | 1 | 3 | 8 | 6 | 20 | 24 | 16 | 12 | 24 | 60 | 10 | 24 |
12+ | 28 | 48 | 40 | 24 | 36 | 24 | 18 | 60 | 16 | 30 | 48 | 24 |
24+ | 100 | 84 | 72 | 48 | 14 | 120 | 30 | 48 | 40 | 36 | 80 | 24 |
36+ | 76 | 18 | 56 | 60 | 40 | 48 | 88 | 30 | 120 | 48 | 32 | 24 |
48+ | 112 | 300 | 72 | 84 | 108 | 72 | 20 | 48 | 72 | 42 | 58 | 120 |
60+ | 60 | 30 | 48 | 96 | 140 | 120 | 136 | 36 | 48 | 240 | 70 | 24 |
72+ | 148 | 228 | 200 | 18 | 80 | 168 | 78 | 120 | 216 | 120 | 168 | 48 |
84+ | 180 | 264 | 56 | 60 | 44 | 120 | 112 | 48 | 120 | 96 | 180 | 48 |
96+ | 196 | 336 | 120 | 300 | 50 | 72 | 208 | 84 | 80 | 108 | 72 | 72 |
108+ | 108 | 60 | 152 | 48 | 76 | 72 | 240 | 42 | 168 | 174 | 144 | 120 |
120+ | 110 | 60 | 40 | 30 | 500 | 48 | 256 | 192 | 88 | 420 | 130 | 120 |
132+ | 144 | 408 | 360 | 36 | 276 | 48 | 46 | 240 | 32 | 210 | 140 | 24 |
Pisano periods of Fibonacci numbers
If n = F, then π = 4k; if n = F, then π = 8k + 4. That is, if the modulo base is a Fibonacci number with an even index, the period is twice the index and the cycle has 2 zeros. If the base is a Fibonacci number with an odd index, the period is 4 times the index and the cycle has 4 zeros.k | F | π | first half of cycle or first quarter of cycle or all cycle |
1 | 1 | 1 | 0 |
2 | 1 | 1 | 0 |
3 | 2 | 3 | 0, 1, 1 |
4 | 3 | 8 | 0, 1, 1, 2, |
5 | 5 | 20 | 0, 1, 1, 2, 3, |
6 | 8 | 12 | 0, 1, 1, 2, 3, 5, |
7 | 13 | 28 | 0, 1, 1, 2, 3, 5, 8, |
8 | 21 | 16 | 0, 1, 1, 2, 3, 5, 8, 13, |
9 | 34 | 36 | 0, 1, 1, 2, 3, 5, 8, 13, 21, |
10 | 55 | 20 | 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, |
11 | 89 | 44 | 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, |
12 | 144 | 24 | 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, |
13 | 233 | 52 | 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144 |
14 | 377 | 28 | 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233 |
15 | 610 | 60 | 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377 |
16 | 987 | 32 | 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610 |
17 | 1597 | 68 | 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987 |
18 | 2584 | 36 | 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597 |
19 | 4181 | 76 | 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584 |
20 | 6765 | 40 | 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181 |
21 | 10946 | 84 | 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765 |
22 | 17711 | 44 | 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765, 10946 |
23 | 28657 | 92 | 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765, 10946, 17711 |
24 | 46368 | 48 | 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765, 10946, 17711, 28657 |
Pisano periods of Lucas numbers
If n = L, then π = 8k; if n = L, then π = 4k + 2. That is, if the modulo base is a Lucas number with an even index, the period is 4 times the index. If the base is a Lucas number with an odd index, the period is twice the index.k | L | π | first half of cycle or first quarter of cycle or all cycle |
1 | 1 | 1 | 0 |
2 | 3 | 8 | 0, 1, |
3 | 4 | 6 | 0, 1, 1, |
4 | 7 | 16 | 0, 1, 1, 2, |
5 | 11 | 10 | 0, 1, 1, 2, 3, |
6 | 18 | 24 | 0, 1, 1, 2, 3, 5, |
7 | 29 | 14 | 0, 1, 1, 2, 3, 5, 8, |
8 | 47 | 32 | 0, 1, 1, 2, 3, 5, 8, 13, |
9 | 76 | 18 | 0, 1, 1, 2, 3, 5, 8, 13, 21, |
10 | 123 | 40 | 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, |
11 | 199 | 22 | 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, |
12 | 322 | 48 | 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, |
13 | 521 | 26 | 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144 |
14 | 843 | 56 | 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233 |
15 | 1364 | 30 | 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377 |
16 | 2207 | 64 | 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610 |
17 | 3571 | 34 | 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987 |
18 | 5778 | 72 | 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597 |
19 | 9349 | 38 | 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584 |
20 | 15127 | 80 | 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181 |
21 | 24476 | 42 | 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765 |
22 | 39603 | 88 | 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765, 10946 |
23 | 64079 | 46 | 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765, 10946, 17711 |
24 | 103682 | 96 | 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765, 10946, 17711, 28657 |
For even k, the cycle has 2 zeros. For odd k, the cycle has only 1 zero, and the second half of the cycle, which is of course equal to the part on the left of 0, consists of alternatingly numbers F and n − F, with m decreasing.
Number of zeros in the cycle
The number of occurrences of 0 per cycle is 1, 2, or 4. Let p be the number after the first 0 after the combination 0, 1. Let the distance between the 0s be q.- There is one 0 in a cycle, obviously, if p = 1. This is only possible if q is even or n is 1 or 2.
- Otherwise there are two 0s in a cycle if p2 ≡ 1. This is only possible if q is even.
- Otherwise there are four 0s in a cycle. This is the case if q is odd and n is not 1 or 2.
The ratio of the Pisano period of n and the number of zeros modulo n in the cycle gives the rank of apparition or Fibonacci entry point of n. That is, smallest index k such that n divides F. They are:
In Renault's paper the number of zeros is called the "order" of F mod m, denoted, and the "rank of apparition" is called the "rank" and denoted.
According to Wall's conjecture,. If has prime factorization then.
Generalizations
The Pisano periods of Pell numbers areThe Pisano periods of 3-Fibonacci numbers are
The Pisano periods of Jacobsthal numbers are
The Pisano periods of -Fibonacci numbers are
The Pisano periods of Tribonacci numbers are
The Pisano periods of Tetranacci numbers are
See also generalizations of Fibonacci numbers.
Number theory
Pisano periods can be analyzed using algebraic number theory.Let be the n-th Pisano period of the k-Fibonacci sequence Fk = 0, Fk = 1, and for any natural number n > 1, Fk = kFk + Fk). If m and n are coprime, then by the Chinese remainder theorem: two numbers are congruent modulo mn if and only if they are congruent modulo m and modulo n, assuming these latter are coprime. For example, and so Thus it suffices to compute Pisano periods for prime powers or Fk, where Fk is the k-Fibonacci sequence, for example, 241 is a 3-Wall-Sun-Sun prime, since 2412 divides F3
For prime numbers p, these can be analyzed by using Binet's formula:
If k2 + 4 is a quadratic residue modulo p, then and can be expressed as integers modulo p, and thus Binet's formula can be expressed over integers modulo p, and thus the Pisano period divides the totient, since any power has period dividing as this is the order of the group of units modulo p.
For k = 1, this first occurs for p = 11, where 42 = 16 ≡ 5 and 2 · 6 = 12 ≡ 1 and 4 · 3 = 12 ≡ 1 so 4 = , 6 = 1/2 and 1/ = 3, yielding φ = · 6 = 30 ≡ 8 and the congruence
Another example, which shows that the period can properly divide p − 1, is π1 = 14.
If k2 + 4 is not a quadratic residue modulo p, then Binet's formula is instead defined over the quadratic extension field , which has p2 elements and whose group of units thus has order p2 − 1, and thus the Pisano period divides p2 − 1. For example, for p = 3 one has π1 = 8 which equals 32 − 1 = 8; for p = 7, one has π1 = 16, which properly divides 72 − 1 = 48.
This analysis fails for p = 2 and p is a divisor of the squarefree part of k2 + 4, since in these cases are zero divisors, so one must be careful in interpreting 1/2 or . For p = 2, is congruent to 1 mod 2, but the Pisano period is not p − 1 = 1, but rather 3. For p divides the squarefree part of k2 + 4, the Pisano period is πk = p2 − p = p, which does not divide p − 1 or p2 − 1.
Fibonacci integer sequences modulo ''n''
One can consider Fibonacci integer sequences and take them modulo n, or put differently, consider Fibonacci sequences in the ring Z/nZ. The period is a divisor of π. The number of occurrences of 0 per cycle is 0, 1, 2, or 4. If n is not a prime the cycles include those that are multiples of the cycles for the divisors. For example, for n = 10 the extra cycles include those for n = 2 multiplied by 5, and for n = 5 multiplied by 2.Table of the extra cycles:
n | multiples | other cycles | number of cycles |
1 | 1 | ||
2 | 0 | 2 | |
3 | 0 | 2 | |
4 | 0, 022 | 033213 | 4 |
5 | 0 | 1342 | 3 |
6 | 0, 0224 0442, 033 | 4 | |
7 | 0 | 02246325 05531452, 03362134 04415643 | 4 |
8 | 0, 022462, 044, 066426 | 033617 077653, 134732574372, 145167541563 | 8 |
9 | 0, 0336 0663 | 022461786527 077538213472, 044832573145 055167426854 | 5 |
10 | 0, 02246 06628 08864 04482, 055, 2684 | 134718976392 | 6 |
11 | 0 | 02246X5492, 0336942683, 044819X874, 055X437X65, 0661784156, 0773X21347, 0885279538, 0997516729, 0XX986391X, 14593, 18964X3257, 28X76 | 14 |
12 | 0, 02246X42682X 0XX8628X64X2, 033693, 0448 0884, 066, 099639 | 07729E873X1E 0EEX974E3257, 1347E65E437X538E761783E2, 156E5491XE98516718952794 | 10 |
Number of Fibonacci integer cycles mod n are: