The Period of The Fibonacci Sequence Modulo J

Download as pdf or txt
Download as pdf or txt
You are on page 1of 12

The Period of the Fibonacci Sequence Modulo j

Charles W. Campbell II
Math 399 Spring 2007
Advisor: Dr. Nick Rogers
Introduction
The main objectives of this project were to examine the Fibonacci sequence mod-
ulo j, a positive integer, with the intentions of generalizing the results to general se-
quences defined by linear recursions and to utilize information being acquired during
the semester. The main part of the research involved investigating the periodicity of
the new sequence obtained after modding out by j. We begin by establishing a moti-
vation for investigating the sequence modulo p a prime and pk a prime power by first
investigating the Fibonacci sequence modulo j, a positive integer. Next we investigate
the Fibonacci sequence modulo p a prime and then generalize to prime powers. True
to the objective the results we obtained were through the use of (but not limited to)
important ideas from both Number Theory and Abstract Algebra including Fermat’s
Little Theorem , Euler’s generalization of Fermat’s Little Theorem, Quadratic Reci-
procity, and Field Theory. Lastly we apply the results established for the Fibonacci
sequence to easily prove results for the Lucas sequence modulo p a prime.

We begin by defining the sequence itself.

Definition The Fibonacci sequence is a linear recursion defined by

Fn+1 = Fn−1 + Fn for n ≥ 1, (1)

where Fn is the nth Fibonacci number with F0 = 0 and F1 = F2 = 1.

In the study of the Fibonacci sequence, it will be nice to be able to calculate the
Fibonacci numbers themselves. There is a closed form equation for doing just that, but
before we prove that this equation gives us the correct members of the sequence, we √
1+ 5
introduce the

following identities which help us in the proof. Throughout let φ = 2
1− 5
and φ̄ = 2 .

Identity 1.
√ !2 √ √ √ √
1+ 5 1+2 5+5 6+2 5 3+ 5 2+1+ 5
φ2 = = = = = = 1 + φ. (2)
2 4 4 2 2
Identity 2.
√ !2 √ √ √ √
1− 5 1−2 5+5 6−2 5 3− 5 2+1− 5
φ̄2 = = = = = = 1 + φ̄. (3)
2 4 4 2 2

We are now prepared to state and prove the first and most widely used result, the
closed form for generating the Fibonacci numbers.

Theorem 1. Fn = √1 (φ n − φ̄ n ).
5

Proof. Using induction on n ∈ N let P(n) be the statement that Fn = √15 (φ n − φ̄ n ).


P(1) is true as
√ √ √ √ √
1 1 1+ 5 1− 5 1+ 5−1+ 5 2 5
F1 = √ (φ − φ̄) = √ ( − )= √ = √ = 1.
5 5 2 2 2 5 2 5

P(2) is true, since by (2) and (3) we have


1 1 1
F2 = √ (φ 2 − φ̄ 2 ) = √ ((1 + φ) − (1 + φ̄)) = √ (φ − φ̄) = F1 = 1.
5 5 5

Now assume that P(n) is true up to some n ∈ N, n > 1, and consider P(n + 1).

1 n−1 n−1 1 n
Fn+1 = Fn−1 + Fn = √ (φ − φ̄ ) + √ (φ − φ̄ n )
5 5

1 n−1
= √ ((φ − φ n ) − (φ̄ n−1
− φ̄ n ))
5

1 n−1 n−1
= √ (φ (1 + φ) − φ̄ (1 + φ̄))
5

and by (2) and (3)

1 n−1 1
= √ (φ (φ 2 ) − φ̄ n−1
(φ̄ 2 )) = √ (φ n+1
− φ̄ n+1
).
5 5
Therefore P(n + 1) is true, so by induction, we conclude that P(n) is true ∀ n ∈ N.
Upon investigating the Fibonacci sequence modulo an integer j, it becomes evi-
dent that this modified sequence is periodic in nature. It should be noted that due to
the nature of the recurrence relation defining Fn , from any point in the sequence, the
future sequence is completely determined by two consecutive terms. Thus, consider-
ing two arbitrary consecutive members of the sequence modulo j, i.e the ordered pairs
(Fn (mod j), Fn+1 (mod j)), we see that there are j choices for each Fn and Fn+1 so that
there are j 2 possibilities for these consecutive numbers. Since there are a finite number
of possibilities for these consecutive elements, our sequence must be eventually periodic,
i.e. that it comes back to some member of the sequence and repeats thereafter. Again,
due to the nature of the recurrence relation, we find that it is reversible, i.e. that we
can go backwards in the sequence. Therefore we must come back to the beginning of
the sequence, and thus we find that Fn (mod j) must be purely periodic. Now that we
know it exists, we are ready to define exactly what is meant by the period modulo j.

Definition The period of the Fibonacci sequence modulo a positive integer j is the
smallest positive integer m such that Fm ≡ 0 (mod j) and Fm+1 ≡ 1 (mod j).

Note that since Fn (mod j) is purely periodic, if m is the period of Fn (mod j), then
every m-th member of the sequence modulo j must come back to the starting point.
By the definition above, the only members that can possibly come back to the starting
point are multiples of m. This can be summed up in the statement that if m is the
period of Fn (mod j), then for any k ∈ Z
(
Fk ≡ 0 (mod j)
⇔ m | k. (4)
Fk+1 ≡ 1 (mod j)

The statement above and the corollary of the following theorem will be crucial in
proving almost every theorem regarding the period modulo j.

Theorem 2. Let p be a prime and let n be a positive integer. If a ≡ 1 (mod p) then


n
ap ≡ 1 (mod pn+1 ).
n
Proof. Suppose that a ≡ 1 (mod p), and let P(n) be the statement that ap ≡
1 (mod pn+1 ). Since a ≡ 1 (mod p), we know that a = 1 + rp for some r ∈ Z.
Since p2 | (rp)i for 2 ≤ i ≤ p we have that
  p   p−1  
p p p X p i 2
X p
a ≡ (1 + rp) ≡ 1 + rp + (rp) ≡ 1 + rp + (rp)i ≡ 1 (mod p2 )
1 i=2
i i=2
i
n
Thus P(1) is true. Now assume that P(n) is true up to some n. So ap ≡ 1 (mod pn+1 )
n
which implies that ap = 1 + spn+1 for some s ∈ Z. Now Consider P(n + 1).

  p   p  
pn+1 pn p n+1 p p n+1
X p n+1 i n+2
X p
a = (a ) = (1+sp ) = 1+ sp + (sp ) = 1+sp + (spn+1 )i
1 i=2
i i=2
i

and since pn+2 | (spn+1 )i for 2 ≤ i ≤ p we have that


p  
pn+1 n+2
X p
a ≡ 1 + sp + (spn+1 )i ≡ 1 (mod pn+2 ).
i=2
i
Therefore P(n) is true by induction.

Corollary 1. Let p be a prime and let k be a positive integer. If m is the period of


Fn (mod p), then
k−1 k−1
φmp ≡ φ̄mp ≡ 1 (mod pk ).

Proof. Since
φm − φ̄m
Fm ≡ √ ≡ 0 (mod p)
5
we have
φm ≡ φ̄m (mod p).

φm+1 − φ̄m+1 φ − φ̄ φm+1 − φ̄m+1 − φ + φ̄ φ(φm − 1) − φ̄(φ̄m − 1)


Fm = Fm+1 −F1 = √ − √ = √ = √ .
5 5 5 5

Substituting φm for φ̄m we get

φ(φm − 1) − φ̄(φ̄m − 1) φ(φm − 1) − φ̄(φm − 1) (φm − 1)(φ − φ̄)


Fm ≡ √ ≡ √ ≡ √
5 5 5

≡ (φm − 1)F1 ≡ (φm − 1) ≡ 0 (mod p).


Thus

φ̄m ≡ φm ≡ 1 (mod p),


so we can apply Theorem 2 to φm and φ̄m to conclude that

k−1 k−1
(φm )p ≡ (φ̄m )p ≡ 1 (mod pk ).

We first investigate the period modulo a positive integer j in order to show that it
is dependent on the period modulo the prime powers that divide j.

s
Y
Theorem 3. Let j be a positive integer with j = pi ki , for pi a prime, and let mi
i=1
denote the period of Fn (mod pi ki ). If m is the period of Fn (mod j), then

m = lcm(m1 , m2 , ..., ms ).
s
Y
Proof. Let j = pi ki be a positive integer, let m be the period of Fn (mod j), and let
i=1
mi be the period of Fn (mod pi ki ). So
(
Fm ≡ 0 (mod j)
Fm+1 ≡ 1 (mod j).

Applying the Chinese Remainder Theorem to these congruences we have that


(
Fmi ≡ 0 (mod pi ki )
∀i.
Fmi +1 ≡ 1 (mod pi ki )

By (4) we also know that for r ∈ Z


(
Frmi ≡ 0 (mod pi ki )
∀i.
Frmi +1 ≡ 1 (mod pi ki )

Letting r = m1 · · · mi−1 · mi+1 · · · ms we have that


s
Y
0
m = rmi = mi
i=1

and  s
Y
Fm0 ≡ 0 (mod p i ki )



i=1
s
Y ∀i.
p i ki )

F 0
 m +1
 ≡ 1 (mod
i=1
But this is not the period because lcm(m1 , m2 , ..., ms ) = m∗ | m0 , and by (4) we have
that  s
Y
F ≡ 0 (mod p i ki )


 m


i=1
Ys ∀i.
 k
Fm∗ +1 ≡ 1 (mod pi ) i


i=1

Therefore since m is the least positive integer satisfying the above, by definition

m = m∗ = lcm(m1 , m2 , ..., ms ).

Because the period modulo j depends on the prime powers dividing j, we are mo-
tivated to investigate the period modulo a prime power. To facilitate this, we need
to look at the period modulo a prime p. In order to do this we must first determine
the conditions under which we can apply Fermat’s Little Theorem to φ, and φ̄. The
following theorem determines the primes for which φ and φ̄ are elements of the field
Z/pZ which we denote Fp .

Theorem 4. Let p 6= 5 be a prime. Then 5 is a quadratic residue modulo p if and


only if p ≡ ±1 (mod 5), and 5 is a quadratic nonresidue modulo p if and only if
p ≡ ±2 (mod 5).

Proof. Let p be a prime. Utilizing Quadratic Reciprocity we have


   
5 p 5−1 p−1
p  p−1 2
 p
= (−1)( 2 )( 2 ) = (−1) 2 =
p 5 5 5

 
1

 =1 ⇔ p ≡ 1 (mod 5)
5







 
2


 5−1

 ≡ 2 2 ≡ −1 (mod 5) ⇔ p ≡ 2 (mod 5)
 5


p
=
5  
3

 5−1
≡ 3 2 ≡ −1 (mod 5) ⇔ p ≡ 3 (mod 5)






 5



   2
4 2


= =1 ⇔ p ≡ 4 (mod 5)



5 5
Therefore 5 is a quadratic residue modulo p if and only if p ≡ ±1 (mod 5), and 5 is a
quadratic nonresidue modulo p if and only if p ≡ ±2 (mod 5).

By the above we conclude that for p ≡ ±1 (mod 5), φ and φ̄ are elements of Fp
and for p ≡ ±2 (mod 5), φ and φ̄ are not elements of Fp . In this second case we need
to find an appropriate extension field of Fp that contains both φ and φ̄. The following
theorems contain results regarding the period modulo p, a prime,

Theorem 5. Let p be a prime and m be the period of Fn (mod p). If p ≡ ±1 (mod 5),
then m | p − 1.

Proof. Let p be a prime, let m be the period of Fn modulo p, and suppose that
p ≡ ±1 mod 5. Theorem 4 tells us that 5 is a quadratic residue for this choice of p,
so we conclude that φ, φ̄ are elements of Fp . Applying Fermat’s Little Theorem, we have

φp−1 ≡ 1 (mod p) and φ̄p−1 ≡ 1 (mod p).


So
1 1
Fp−1 ≡ √ φp−1 − φ̄p−1 ≡ √ (1 − 1) ≡ 0 (mod p)

5 5
and
1 1
Fp ≡ √ φp − φ̄p ≡ √ φ − φ̄ (mod p)
 
5 5

√ √ ! √
1 1+ 5−1+ 5 1 2 5
≡√ ≡√ (mod p)
5 2 5 2

≡ 1 (mod p).

Therefore we have that (


Fp−1 ≡ 0 (mod p)
Fp ≡ 1 (mod p),

so by (4) we have that m p − 1.
Theorem 6. Let p be a prime and m be the period of Fn (mod p). If p ≡ ±2 (mod 5),
then m | 2p + 2, with 2p+2
m
odd.
Proof. Let p be a prime, let m be the period of Fn mod p, and suppose that
p ≡ ±2 mod 5. The Legendre symbol satisfies
 
a p−1
≡ a 2 (mod p).
p
p−1
For our choice of p and a = 5, Theorem 2 tells us that 5 2 (mod p) ≡ −1, and thus φ
and φ̄ are not in Fp . Therefore we work in the splitting field for x2 − 5 over Fp ,
√ n √ o
Fp ( 5) = a + b 5 | a, b ∈ Fp .
p−1
Since this field has characteristic p and 5 2 (mod p) ≡ −1, we have

√ !p √ !p  p √ !p
1+ 5 1 5 1 5
φp = = + = +
2 2 2 2 2

 p 
1 √ p 1  p−1 √

= 1+ 5 = 1+5 2 5
2 2


1 √  1− 5
= 1− 5 =
2 2

= φ̄.
Similarly
√ !p √ !p  p √ !p
1− 5 1 5 1 5
φ̄p = = − = −
2 2 2 2 2

 p 
1 √ p 1  p−1 √

= 1− 5 = 1−5 2 5
2 2


1 √  1+ 5
= 1+ 5 =
2 2

= φ.
Therefore it is easily seen that

φp − φ̄p φ̄ − φ
Fp ≡ √ ≡ √ ≡ (p − 1) (mod p),
5 5
φp+1 − φ̄p+1 φp φ − φ̄p φ̄ φ̄φ − φφ̄
Fp+1 ≡ √ ≡ √ ≡ √ ≡ 0 (mod p),
5 5 5

and

Fp+2 ≡ Fp + Fp+1 ≡ (p − 1) (mod p)


.

Therefore, for our choice of p, we see that m does not divide p + 1. It is seen that

2
φ2p+1 − φ̄2p+1 (φp )2 φ − φ̄p φ̄
F2p+1 ≡ √ ≡ √ (mod p)
5 5

φ̄2 φ − φ2 φ̄
 
φ̄ − φ
≡ √ ≡ φφ̄ √ (mod p)
5 5

≡ (−1) (−F1 ) ≡ (−1)(−1) (mod p)

≡ 1 mod p,

2
φ2p+2 − φ̄2p+2 (φp )2 φ2 − φ̄p φ̄2 φ̄2 φ2 − φ2 φ̄2
F2p+2 ≡ √ ≡ √ ≡ √ ≡ 0 (mod p),
5 5 5
and

F2p+3 ≡ F2p+1 + F2p+2 ≡ 1 (mod p).

Therefore, since (
F2p+2 ≡ 0 (mod p)
F2p+3 ≡ 1 (mod p),
2p+2

by (4) we have that m 2p + 2, and since m does not divide p + 1, m
must be odd.

Now that we have results regarding the period of Fn (mod p) we are ready to inves-
tigate the period modulo a prime power, i.e. the period of Fn (mod pk ).
Theorem 7. Let p be a prime, let m denote the period of Fn modulo p, and let m0
denote the period of Fn modulo pk . Then m0 | mpk−1 .
Proof. By Corollary 1 we know that
k−1 k−1
φmp ≡ φ̄mp ≡ 1 (mod pk ).

Therefore k−1 k−1


φmp − φ̄mp 1−1
Fmpk−1 ≡ √ ≡ √ ≡ 0 (mod pk )
5 5
and

k−1 +1 k−1 +1 k−1 k−1


φmp − φ̄mp (φmp )φ − (φ̄mp )φ̄ φ − φ̄
Fmpk−1 +1 ≡ √ ≡ √ ≡ √ ≡ 1 (mod pk )
5 5 5
Therefore by (4) we have that m0 | mpk−1 .

In every known case of the above theorem m0 = mpk−1 , but there are thought to be
infinitely many primes for which this is not true. Since we now have results regarding
the period of Fn (mod pk ) we can apply Theorem 3 to tell us about the period modulo
the product of prime powers. Therefore given a positive integer j we can determine the
possibilities for the period of Fn (mod j). That is, given j a positive integer and m
the period modulo j, we can apply Theorems 3, 5, 6, and 7 to tell us that m divides a
certain number t, but we can’t be certain if t equals m or not.

We now turn our attention to another sequence defined by a recursion relation that
is closely related to the Fibonacci sequence, the Lucas sequence.

Definition The Lucas sequence is a linear recursion defined by

Ln+1 = Ln−1 + Ln , for n ≥ 1,

where Ln is the nth Lucas number with L0 = 2 and L1 = 1.

Like the Fibonacci numbers, there is a closed form equation that makes calculating
the Lucas numbers easier.


Theorem 8. Ln = φn + φ̄n

Proof. Using induction, let P(n) be the statement Ln = φn + φ̄n . P(0) is true since

L0 = φ0 + φ̄0 = 1 + 1 = 2
and P(1) is true as
√ √
1+ 5+1− 5 2
L1 = φ + φ̄ = = = 1.
2 2

Now assume that P(n) is true for some n ∈ N and consider P(n + 1).

Ln+1 = φn+1 + φ̄n+1 = φn−1 φ2 + φ̄n−1 φ̄2


 

= φn−1 (1 + φ) + φ̄n−1 1 + φ̄


= φn−1 + φn + φ̄n−1 + φ̄n


= φn−1 + φ̄n−1 + φn + φ̄n
 

= Ln−1 + Ln

Therefore P(n) is true for all n.

Like the Fibonacci sequence, when we investigate the Lucas sequence modulo j an
integer, we find that the new sequence is purely periodic and for the same reasons as
Fibonacci sequence.

Definition The period of the Lucas sequence modulo a positive integer j is the smallest
positive integer l such that Ll ≡ 2 (mod j) and Ll+1 ≡ 1 (mod j).

Again, for the same reasons as the Fibonacci sequence we have that if l is the period
of Ln (mod j) then (
Lk ≡ 2 (mod j)
⇔l|k (5)
Lk+1 ≡ 1 (mod j)

Theorem 9. For p be a prime, let l be the period of Ln (mod p). If p ≡ ±1(mod 5),
then l | p − 1.
Proof. Let p be a prime, let l be the period of Ln mod p and suppose that
p ≡ ±1 (mod 5). Since p ≡ ±1 (mod 5) we know that φ, φ̄ ∈ Fp and thus

Lp−1 ≡ φp−1 + φ̄p−1 ≡ 1 + 1 mod p ≡ 2 (mod p)


and √ √
1 + 5 1 − 5 2
Lp ≡ φp + φ̄p ≡ φ + φ̄ ≡ + = ≡ 1 (mod p).
2 2 2

Therefore by (5) we have that l p − 1.

Theorem 10. For p be a prime, let l be the period of Ln (mod p). If p ≡ ±2 (mod 5),
then l | 2p + 2.

Proof. Let p be a prime, let l be the period of Ln (mod p) and suppose that
p ≡ ±2 (mod 5). Since p ≡ ±2 (mod 5) we know that φp ≡ φ̄ (mod p) and
φ̄p ≡ φ (mod p). Thus we have

L2p+2 ≡ φ2p+2 + φ̄2p+2 ≡ (φp )2 φ2 + (φ̄p )2 φ̄2 (mod p)

≡ φ̄2 φ2 + φ2 φ̄2 ≡ 2(φφ̄)2 ≡ 2(−1)2 (mod p)

≡ 2 (mod p)

and

L2p+3 ≡ φ2p+3 + φ̄2p+3 ≡ (φp )2 φ3 + (φ̄p )2 φ̄3 (mod p)

≡ φ̄2 φ3 + φ2 φ̄3 ≡ (φφ̄)2 (φ + φ̄) ≡ (−1)2 (1) (mod p)

≡ 1 (modp).

Therefore by (5) we have that l 2p + 2.

References
[1] Gallian, Joe A. Contemporary Abstract Algebra. Sixth Edition. Houghton
Mifflin. 2006.

[2] Niven, Zuckerman, Montegomery. An Introduction to the Theory of Numbers.


Fifth Edition. John Wiley Sons, Inc. 1991.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy