Modular Arithmetic • Topic 2 of 3

Modular Operations

The reason congruences are a CAT weapon is that they survive addition, multiplication and powers. Concretely, a^k mod m equals (a mod m)^k mod m, so you reduce the base before raising it. To kill a large exponent, find a small power of the base that is ≡ 1 or ≡ −1, then ride the cycle. Example: for 2^500 mod 7, note 2^3 = 8 ≡ 1, so 2^500 = 2^(3×166+2) ≡ 1^166 × 2^2 = 4. The −1 trick is even faster: 6 ≡ −1 (mod 7) means 6^odd ≡ −1 ≡ 6 and 6^even ≡ 1. Two named shortcuts cut the work further. Fermat’s little theorem: for a prime p with gcd(a,p)=1, a^(p−1) ≡ 1 (mod p) — so 3^6 ≡ 1 (mod 7). Euler’s theorem generalises it to any modulus using φ(m). Reduce the exponent modulo (p−1) or φ(m), then finish off the small remaining power.

✅ Solved examples

1. Find the remainder when 3^100 is divided by 5.
3^4 = 81 ≡ 1 (mod 5). 100 = 4×25, so 3^100 ≡ 1^25 = 1. Remainder 1.
2. Find the units digit of 7^85.
Units digit cycles 7,9,3,1 with period 4. 85 = 4×21 + 1, so it matches 7^1 → units digit 7.
3. Find the remainder when 2^500 is divided by 7.
2^3 = 8 ≡ 1 (mod 7). 500 = 3×166 + 2, so 2^500 ≡ 1^166 × 2^2 = 4. Remainder 4.
4. Using Fermat, find the remainder when 3^101 is divided by 7.
3^6 ≡ 1 (mod 7). 101 = 6×16 + 5, so 3^101 ≡ 3^5 = 243 ≡ 243 − 238 = 5 (mod 7). Remainder 5.

✏️ Practice — try these, take hints as needed

1. Find the remainder when 4^60 is divided by 5.
4 ≡ −1 (mod 5).
(−1)^60.
Even power.
1
2. Find the units digit of 3^64.
Cycle 3,9,7,1 (period 4).
64 mod 4 = 0.
Position 4 of the cycle.
1
3. Find the remainder when 2^100 is divided by 3.
2 ≡ −1 (mod 3).
(−1)^100.
Even.
1
4. Find the remainder when 5^123 is divided by 6.
5 ≡ −1 (mod 6).
(−1)^123.
Odd power gives −1.
5
5. Find the remainder when 7^77 is divided by 4.
7 ≡ 3 ≡ −1 (mod 4).
(−1)^77.
Odd → −1 ≡ 3.
3

📝 Topic test — 8 questions

Auto-graded with full solutions; saved to your dashboard. Use the calculator and formula sheet (top-right) any time.

Loading questions…