ModularArithmetic2

Modular Arithmetic: Fermat’s Theorem,
The Chinese Remainder Theorem, Euler’s Theorem
𝑨 ≑ 𝑩 (π’Žπ’π’… 𝒏)
𝑨 βˆ’ 𝑩 π’Šπ’” 𝒂 π’Žπ’–π’π’•π’Šπ’‘π’π’† 𝒐𝒇 𝒏
means:
𝑨=𝑩+π’Œ×𝒏
equivalently:
for some integer π‘˜.
General Mod Arithmetic rules:
If
π‘¨πŸ ≑ π‘©πŸ (π’Žπ’π’… 𝒏)
and π‘¨πŸ ≑ π‘©πŸ (π’Žπ’π’… 𝒏) then
π‘¨πŸ + π‘¨πŸ ≑ π‘©πŸ + π‘©πŸ (π’Žπ’π’… 𝒏),
π‘¨πŸ π‘¨πŸ ≑ π‘©πŸ π‘©πŸ (π’Žπ’π’… 𝒏),
π‘¨π’ŒπŸ ≑ π‘©π’ŒπŸ (π’Žπ’π’… 𝒏).
1. Mod 5:
21 ≑
31 ≑
41 ≑
20141 ≑
22 ≑
32 ≑
42 ≑
20142 ≑
23 ≑
33 ≑
43 ≑
20143 ≑
24 ≑
34 ≑
44 ≑
20144 ≑
22012 ≑
32012 ≑
42012 ≑
20142012 ≑
22014 ≑
32014 ≑
42014 ≑
20142014 ≑
Conclusion:
π’‚πŸ’ ≑ 𝟏
(mod πŸ“)
for all integers 𝒂 β‰  multiple of 5.
2. Mod 7:
21 ≑
31 ≑
41 ≑
20141 ≑
22 ≑
32 ≑
42 ≑
20142 ≑
23 ≑
33 ≑
43 ≑
20143 ≑
26 ≑
36 ≑
46 ≑
20146 ≑
22014 ≑
32014 ≑
42014 ≑
20142014 ≑
Conclusion:
π’‚πŸ” ≑ 𝟏
(mod πŸ•)
for all integers 𝒂 β‰  multiple of 7.
3. Fermat’s Little Theorem:
If 𝒑 is a prime number and 𝒂 is a number not divisible by 𝒑, then
Equivalently,
π’‚π’‘βˆ’πŸ ≑ 𝟏
(mod 𝒑).
𝒂𝒑 ≑ 𝒂
(mod 𝒑).
Hint for proof: Given as many beads as you want in 𝒂 available colours, how many different
types of necklaces of 𝒑 beads can you form which use more than just 1 colour? 𝒑 is prime.
4. Calculate π‘Ž) 32014 (mod 11)
𝑏) 999999 (mod 11).
𝑐) 201313 (mod 13)
𝑑) 100100 (mod 31)
Products:
Mod 35:
If we know a number 𝑨 (mod 5) and 𝑨 (mod 7), then we can find 𝑨 (mod 35) uniquely.
5. Use the results from exercises 1 and 2 to fill in the first two rows, and then use these to
calculate the entries in the last row.
22014 ≑
(mod 5)
32014 ≑
(mod 5)
20142014 ≑
(mod 5)
22014 ≑
(mod 7)
32014 ≑
(mod 7)
20142014 ≑
(mod 7)
22014 ≑
(mod 35) 32014 ≑
(mod 35)
20142014 ≑
(mod 35)
Hint: If 𝐴 ≑ a (mod 5) and 𝐴 ≑ b (mod 7) , then 𝐴 = 5π‘₯ + π‘Ž ≑ b (mod 7). Use this
equation to find π‘₯ (mod 7). That’s enough to determine 𝐴 (mod 35).
The Chinese Remainder Theorem:
If π’Ž and 𝒏 are relatively prime (no common factors >1, or equivalently gcd(π’Ž, 𝒏)=1 ), then
𝑨 (mod π’Ž) and 𝑨 (mod 𝒏), are enough to uniquely determine 𝑨 (mod π’Žπ’).
6. Let π‘Ž be a number not divisible by 5, 7, 11, or 13. Prove the following:
i) π‘Ž24 ≑ 1 (mod 35),
ii) π‘Ž720 ≑ 1 (mod 1001).
Hint: Use the Chinese Remainder Theorem together with Fermat’s Little Theorem.
In general:
If 𝒏 = π’‘πŸ π’‘πŸ β‹― 𝒑𝒔 is a product of distinct primes and if 𝒂 is not divisible by any of these,
then
𝒂(π’‘πŸ βˆ’πŸ)(π’‘πŸ βˆ’πŸ)β‹―(π’‘π’”βˆ’πŸ) ≑ 𝟏 (mod π’‘πŸ π’‘πŸ β‹― 𝒑𝒔 ).
Powers:
7. a) If 𝒂 ≑ 𝒃 (mod 5), prove the following:
i) π’‚πŸ“ ≑ π’ƒπŸ“ (mod 25),
ii) π’‚πŸπŸ“ ≑ π’ƒπŸπŸ“ (mod 125),
iii) π’‚πŸπŸπŸ“ ≑ π’ƒπŸπŸπŸ“ (mod 625).
b) If 𝒂 is not a multiple of 5, prove the following:
i) π’‚πŸπŸŽ ≑ 𝟏 (mod 25),
ii) π’‚πŸπŸŽπŸŽ ≑ 𝟏 (mod 125),
iii) π’‚πŸ“πŸŽπŸŽ ≑ 𝟏 (mod 625).
Hint: a) i) Use π‘Ž5 βˆ’ 𝑏 5 = (π‘Ž βˆ’ 𝑏)(π‘Ž4 + π‘Ž3 𝑏 + π‘Ž2 𝑏 2 + π‘Žπ‘ 3 + 𝑏 4 ) and calculate each of
these factors mod 5. ii) Use π‘Ž25 = (π‘Ž5 )5 . b) Use a) and Fermat’s Little Theorem.
In general:
Let 𝒑 be a prime number. If 𝒂 ≑ 𝒃 (mod 𝒑), then:
i) 𝒂𝒑 ≑ 𝒃𝒑 (mod π’‘πŸ ),
𝟐
𝟐
π’Œ
ii) 𝒂𝒑 ≑ 𝒃𝒑 (mod π’‘πŸ‘ ),
π’Œ
iii) 𝒂𝒑 ≑ 𝒃𝒑 (mod π’‘π’Œ+𝟏 ).
b) If 𝒑 is a prime number and 𝒂 is a number not divisible by 𝒑, then
𝒂(π’‘βˆ’πŸ)𝒑
π‘˜
Hint: a) iii): Induction, using π‘Žπ‘ = (π‘Žπ‘
π‘˜βˆ’1
π’βˆ’πŸ
β‰‘πŸ
(mod 𝒑𝒏 ).
𝑝
) .
Euler’s Theorem:
π’Œ
π’Œ
π’Œ
If 𝒏 = π’‘πŸπŸ π’‘πŸπŸ β‹― 𝒑𝒔 𝒔 is the prime factorization of 𝒏, we define Euler’s number of 𝒏 by:
π’Œ βˆ’πŸ
π’Œ βˆ’πŸ π’ŒπŸ βˆ’πŸ
π’‘πŸ
β‹― 𝒑𝒔 𝒔 .
𝝋(𝒏) = (π’‘πŸ βˆ’ 𝟏)(π’‘πŸ βˆ’ 𝟏) β‹― (𝒑𝒔 βˆ’ 𝟏)π’‘πŸπŸ
If 𝒂 is not divisible by any of these primes, then
π’ŒπŸ βˆ’πŸ π’ŒπŸ
π’Œ
π’‘πŸ ⋯𝒑𝒔 𝒔
𝒂(π’‘πŸ βˆ’πŸ)(π’‘πŸ βˆ’πŸ)β‹―(π’‘π’”βˆ’πŸ)π’‘πŸ
β‰‘πŸ
(mod 𝒏).
Exercise:
𝝋(𝒏) = how many positive numbers smaller than 𝒏 are relatively prime with 𝒏.