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 π.
© Copyright 2026 Paperzz