Fermats and Wilsons Theorem

You might also like

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

SP MATH 120

Number Theory

CHAPTER 3 MODULAR ARITHMETIC

LESSON 2 FERMAT’S AND WILSON’S THEOREM

Introduction
In this lesson we present three applications of congruences. The first theorem is
Euler’s theorem which is a generalization of Fermat’s theorem and it states that for any
positive integer 𝑚 that is relatively prime to an integer 𝑎, 𝑎𝜙(𝑚) ≡ 1 (mod m) where
𝜙 is the Euler’s 𝜙-function. Next, we present Wilson’s theorem which states that
(𝑝 − 1)! Is divisible by 𝑝 for 𝑝 prime. Finally, we present Fermat’s theorem, also
known as Fermat’s little theorem which states that 𝑎𝑝 and 𝑎 have the same tremainders
when divided by 𝑝 where 𝑝 ∤ 𝑎.

Learning Outcomes
At the end of the lesson, you are expected to:
• Apply knowledge of Euler’s theorem, Wilson’s theorem and Fermat’s theorem
to solve congruences.

Learning Activities

Determine the remainder of the following integers. Write your answer on a separate
sheet of paper.

1. 15│126
2. 21│623
3. 17│135
4. 33│989
5. 26│467

Analysis

1. How did you determine the remainder of the integers? (State your process).

_________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________

2. What operations did you use to find all factors of the integers?
_________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________

3. Based on the activity, Make a conclusion.

80
SP MATH 120
Number Theory

_________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________

Abstraction

According to (Ortega) we can use the following definitions, properties and theorems to
solve congruences.
Least Positive Residue

Definition: If 𝑎 is a natural number and 𝑏 is an integer, let 𝑏 = 𝑞𝑎 + 𝑟, where 0 ≤ 𝑟 ≤


𝑎 − 1. We say that 𝑟 is the least positive residue of 𝑏 (mod 𝑚).

Example

Find the least positive residue when 4700 is divided by 17.

Solutions: In solving this problem, it is just like solving for 𝑛 in the linear congruence
4750 ≡ 𝑛 (mod 17).

Since 416 ≡ 1 (mod 17), then we have

4750 ≡ (416 )46 ∙ (47 )2 (mod 17)

≡ 146 ∙ 132 (mod 17)

≡ 1 ∙ 169 (mod 17)

4750 ≡ 16 (mod 17)

thus, 𝑛 = 16. Therefore, the least positive residue is 16.

Example

Find the least positive residue when 3147 is divided by 11.

Solutions

3147 ≡ (310 )14 ∙ 37 (mod 11)

≡ 114 ∙ 9 (mod 11)

≡ 1 ∙ 9 (mod 11)

3147 ≡ 9 (mod 11)

81
SP MATH 120
Number Theory

Try me!

Apply definition discussed above to find the least positive residue of the following
integers. Write your answer on a separate sheet of paper.

1. Find the least positive residue when 7224 is divided by 12.


2. Find the least positive residue when 36540 is divided by 21.

Theorem. Euler’s Theorem. Let 𝑎 ∈ 𝑍 and 𝑚 ∈ 𝑁 such that 𝑔𝑐𝑑(𝑎, 𝑚) = 1. Then

𝑎𝜙(𝑚) ≡ 1(mod 𝑚)
Example
What is the remainder when 32147 is divided by 27?
Solutions
Since 𝜙 (27) = 1, 2, 4, 5, 7, 8, 10, 11, 13, 14, 16, 17, 19, 20, 22, 23, 25, 26 then
𝜙(27) ≡ 18 and 𝑔𝑐𝑑(32, 27) ≡ 1, by Euler’s theorem, we have 3218 ≡ 1(mod 27).
Thus,
32147 ≡ (3218 )8 ∙ 323 (mod 27) Factor exponential function by the 𝜙 (27)
≡ (18 ) ∙ 323 (mod 27) Apply Euler’s theorem
≡ 1 ∙ 32768(mod 27) Simplify 18 using mod 27
32147 ≡ 17(mod 27) Solution
So, the remainder is 17 when 32147 is divided by 27.
Example
What is the remainder when 1747 is divided by 12?
Solution
Since 𝜙 (12) = 1, 5, 7, 11 then 𝜙 (27) = 4 and 𝑔𝑐𝑑(17, 12) = 1, by Euler’s
theorem, we have 174 = 1(mod 12). Thus,
1747 ≡ (174 )11 ∙ 173 (mod 12)
≡ 111 ∙ 173 (mod 12)
≡ 1 ∙ 4913 (mod 12)
1747 ≡ 5 (mod 12)
So, the remainder is 5 when 1747 is divided by 12.

82
SP MATH 120
Number Theory

Try me!
Apply Euler’s theorem to solve the following congruences. Write your answer on a
separate sheet of paper.
1. What is the remainder when 25247 is divided by 36?
2. What is the remainder when 19125 is divided by 23?

In case when 𝑚 = 𝑝 is prime, 𝜙(𝑚) = 𝑝 − 1, we have the following theorem.


Theorem. Wilson’s Theorem. If 𝑝 is a prime, then (𝑝 − 1)! ≡ −1(mod 𝑝).
Example
Find the remainder when 100! is divided by 103.
Solution
That is, you are going to solve for 𝑛 in the congruence 90! ≡ 𝑛(mod 97). By
Wilson’s Theorem, 100! ≡ −1(mod 103), thus
102 ∙ 101 ∙ 100! ≡ −1(mod 103)
(−1)(−2)(100!) ≡ −1(mod 103)

2 ∙ 100! ≡ −1(mod 103)


Since, 52 ∙ 2 ≡ 1(mod 103), thus we have 52 is the difference between 103 and 51
52 ∙ 2 ∙ 100! ≡ 52 ∙ −1(mod 103)
100! ≡ −52(mod 103)
100! ≡ 51(mod 103)
Therefore, the remainder is 51 when 100! is divided by 103.
Another example.
What is the remainder when 90! is divided by 97?
Solution
96 ∙ 95 ∙ 94 ∙ 93 ∙ 92 ∙ 91 ∙ 90! ≡ −1 (mod 97)
(−1) ∙ (−2) ∙ (−3) ∙ (−4) ∙ (−5) ∙ (−6) ∙ 90! ≡ −1 (mod 97)

720 ∙ 90! ≡ −1 (mod 97)


41 ∙ 90! ≡ −1 (mod 97)
Since, 71 ∙ 41 ≡ 1 (mod 97), thus we have
71 ∙ 41 ∙ 90! ≡ 71 ∙ −1 (mod 97)
90! ≡ −71 (mod 97)

83
SP MATH 120
Number Theory

90! ≡ 26 (mod 97)


Therefore, the remainder is 26 when 90! Is divisible by 97.
Try Me!
Apply Wilson’s theorem to solve the following congruences. Write your answer on a
separate sheet of paper.
1. What is the remainder when 82! is divided by 91?
2. What is the remainder when 97! Is divided by 101?
Theorem. Fermat’s Little Theorem. If 𝑝 is a prime number and 𝑎 is a natural number,
then 𝑎𝑝 ≡ 𝑎 (mod 𝑝). Furthermore, if 𝑝 ∤ 𝑎, then there exists some smallest exponent
𝑑 such that 𝑎𝑑 − 1 ≡ 0 (mod 𝑝) where 𝑑 is equivalent to 𝑝 − 1. Hence, 𝑎𝑝−1 − 1 ≡
0 (mod 𝑝).
Example
What is the remainder when 2443 is divided by 43?
Solution
By Fermat’s little theorem. Thus,
𝑎𝑝 ≡ 𝑎 (mod 𝑝)
2443 ≡ 24 (mod 43)
Furthermore,
𝑎𝑑 − 1 ≡ 0 (mod 𝑝)
2442 − 1 ∙ 431 ≡ 0 (mod 43)
0 ∙ 43 ≡ 0 (mod 43)
So, 2442 − 1 ∙ 431 ≡ 0 (mod 43).
Hence,
𝑎𝑝−1 − 1 ≡ 0 (mod 𝑝)
2443−1 − 1 ≡ 0 (mod 𝑝)
2442 − 1 ≡ 0 (mod 𝑝).
Therefore, the remainder is 24 when 2443 is divided by 43.
Example
What is the remainder when 15831 is divided by 31?
Solution
By Fermat’s little theorem. Thus,
𝑎𝑝 ≡ 𝑎 (mod 𝑝)

84
SP MATH 120
Number Theory

15831 ≡ 3 (mod 31)


331 ≡ 3 (mod 31)
Furthermore,
𝑎𝑑 − 1 ≡ 0 (mod 𝑝)
330 − 1 ∙ 31 ≡ 0 (mod 31)
0 ∙ 31 ≡ 0 (mod 31)
0 ∙ 3 ≡ 0 (mod 31)
So, 330 − 1 ∙ 31 ≡ 0 (mod 31)
Hence,
𝑎𝑝−1 − 1 ≡ 0 (mod 𝑝)
331−1 − 1 ≡ 0 (mod 31)
330 − 1 ≡ 0 (mod 31)
1 − 1 ≡ 0 (mod 31)
So, 331−1 − 1 ≡ 0 (mod 31).
Therefore, the remainder is 3 when 15831 is divided by 31.
Try me!
Apply Fermat’s little theorem to solve the following congruences. Write on a separate
sheet of paper.
1. What is the remainder 1773 is divided by 73?
2. What is the remainder 525127 is divided by 127?
Overall analysis
1. How will you apply knowledge of Euler’s theorem, Wilson’s theorem and
Fermat’s theorem to solve congruences?
_________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
3. What are the steps in applying knowledge of Euler’s theorem, Wilson’s theorem
and Fermat’s theorem to solve congruences?
_________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
4. Make a conclusion on your learning about the lesson.

85
SP MATH 120
Number Theory

_________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________

Application
Apply the different definitions, and theorems to solve and following linear
congruences. Write your answer on a separate sheet.
1. What is the remainder when 2761 is divide by 61?
2. What is the remainder when 27354 is divide by 18?
3. Find the remainder when 99! is divided by 107.
Assessment
Apply knowledge of Euler’s theorem, Wilson’s theorem and Fermat’s theorem to solve
congruences. Write your answer on a separate sheet of paper.

1. What is the remainder when 90348 is divide by 29?


2. What is the remainder when 2761 is divide by 61?
3. What is the remainder when 39298 is divide by 15?
4. What is the remainder when 29! is divided by 37?
5. What is the remainder when 73! Is divided by 91?
Agreement
Apply knowledge of tau, phi and sigma function of the following factorial notation.
Write your answer on a separate sheet of paper.
1. Find the remainder when 62! divided by 67.
2. Find the remainder when 69! divided by 73.
3. Find the remainder when 70! divided by 79.
4. Find the remainder when 76! divided by 83.
5. Find the remainder when 80! divided by 89.
References:
Daileda, R. C. (2018, February 17). Euler’s, Fermat’s and Wilson’s Theorems.
Retrieved July 20, 2020, from Euler.pdf:
http://ramanujan.math.trinity.edu/rdaileda/teach/s18/m3341/Euler.pdf
Ortega, O. M. (n.d.). Math 527 - Number Theory. Tacloban City, Leyte, Philippines.
Retrieved September 30, 2018.
Pakapongpun, A. (2018, April 15). THE RELATION AMONG EULER'S PHI
FUNCTION, TAU FUNCTION, AND SIGMA FUNCTION. International
Journal of Pure and Applied Mathematics, Volume 118(3 2018, 675-684), 675-
685. doi:10.12732/ijpam.v11i3.15. Retrieved July 9, 2020, from
https://ijpam.eu/contents/2018-118-3/15/15.pdf.

86
SP MATH 120
Number Theory

WIKIPEDIA. (n.d.). Retrieved July 9, 2020, from Divisor function:


https://en.wikipedia.org/wiki/Divisor_function#:~:text=In%20mathematics%2
C%20and%20specifically%20in,1%20and%20the%20number%20itself).
WIKIPEDIA. (n.d.). Retrieved July 9, 2020, from Euler's totient function:
https://en.wikipedia.org/wiki/Euler%27s_totient_function#:~:text=In%20num
ber%20theory%2C%20Euler's%20totient,be%20called%20Euler's%20phi%20
function.&text=For%20example%2C%20the%20totatives%20of,%2C%205%
2C%207%20and%208.

87

You might also like