Introduction
When exponents become very large, direct division to find remainders is inefficient. This is where Euler’s and Fermat’s Theorems are powerful tools. They help simplify modular arithmetic by reducing large exponents based on number properties.
Pattern: Remainder Theorems (Euler/Fermat)
Pattern
Euler’s and Fermat’s theorems simplify finding remainders for large powers by using modular reduction and special exponent rules.
-
Fermat’s Little Theorem (FLT):
Ifpis a prime number andais not divisible byp, then:
ap-1 ≡ 1 (mod p)
⇒ ak mod p = a(k mod (p-1)) mod p -
Euler’s Theorem (Generalized):
Ifaandnare coprime (GCD(a, n) = 1), then:
aφ(n) ≡ 1 (mod n)
where φ(n) = number of integers less than n that are coprime to n (Euler’s Totient Function).
⇒ ak mod n = a(k mod φ(n)) mod n -
Euler’s Totient Function φ(n):
φ(n) = n × (1 - 1/p₁) × (1 - 1/p₂) × … for all distinct prime factors of n.
Example: φ(10) = 10 × (1-1/2) × (1-1/5) = 10×(1/2)×(4/5) = 4 -
Shortcut Relation:
- If modulus n is prime → use Fermat’s theorem.
- If modulus n is composite but coprime with base → use Euler’s theorem.
- If not coprime → split and use Chinese Remainder Theorem or basic modular reduction.
Step-by-Step Example
Question
Find the remainder when 7100 is divided by 13.
Solution
-
Step 1: Recognize the modulus is prime:
Since 13 is prime, use Fermat’s Little Theorem: ap-1 ≡ 1 (mod p). -
Step 2: Apply theorem:
712 ≡ 1 (mod 13). -
Step 3: Reduce exponent modulo (p-1):
100 mod 12 = 4. So 7100 ≡ 74 (mod 13). -
Step 4: Compute reduced power:
72 = 49 → 49 mod 13 = 10.
74 = (72)² = 10² = 100 → 100 mod 13 = 9. -
Final Answer:
Remainder = 9. -
Quick Check:
Verified using modular reduction - 7¹² ≡ 1 mod 13, 7⁴ → remainder 9 ✅
Quick Variations
1. When modulus is prime → use Fermat’s theorem.
2. When modulus is composite and coprime with base → use Euler’s theorem.
3. If modulus shares factors with base → split the modulus and use Chinese Remainder Theorem.
4. When exponent is extremely large → reduce the exponent stepwise using φ(n) repeatedly.
Trick to Always Use
- Step 1: Check if modulus is prime → use Fermat’s theorem.
- Step 2: If not prime but coprime → use Euler’s theorem (find φ(n)).
- Step 3: Always reduce exponent mod (p-1) or φ(n).
- Step 4: Multiply results only modulo n to keep numbers small.
Summary
Summary
- Fermat’s theorem: ap-1 ≡ 1 (mod p) for prime p.
- Euler’s theorem: aφ(n) ≡ 1 (mod n) when GCD(a,n)=1.
- Reduce exponents using (p-1) or φ(n) to simplify calculations.
- Compute modular powers step-by-step using squaring to avoid large numbers.
