Remainder Theorem
The single habit that solves most remainder problems: never carry the full number — replace it by its remainder immediately. Because remainders respect addition and multiplication, you can reduce each factor mod n before combining. So the remainder of a product is the product of the remainders (then reduce again), and the remainder of a power a^k mod n is (a mod n)^k mod n. The CAT skill is spotting a cycle: powers of any base repeat their remainders periodically, so find the cycle length and reduce the exponent mod that length. For example 2^1,2^2,… mod 7 cycle through 2,4,1 with period 3, so 2^100 mod 7 = 2^(100 mod 3) = 2^1 = 2. Always shrink the base first, then hunt for the smallest power that gives 1 or −1.
✅ Solved examples
✏️ Practice — try these, take hints as needed
📝 Topic test — 8 questions
Auto-graded with full solutions; saved to your dashboard. Use the calculator and formula sheet (top-right) any time.
Formula Reference Sheet
Modular reduction core
| Notation | a ≡ r (mod n) means n divides (a − r) |
|---|---|
| Sum / difference | (a ± b) mod n = (a mod n ± b mod n) mod n |
| Product | (a × b) mod n = ((a mod n)(b mod n)) mod n |
| Power | a^k mod n = (a mod n)^k mod n |
| Negative remainder | if a ≡ −1 (mod n) then a^k ≡ (−1)^k (mod n) |
Named theorems
| Fermat’s little theorem | a^(p−1) ≡ 1 (mod p), p prime, gcd(a,p)=1 |
|---|---|
| Euler’s theorem | a^φ(n) ≡ 1 (mod n), gcd(a,n)=1 |
| Euler’s totient | φ(n) = n·∏(1 − 1/p) over distinct primes p | n |
| Wilson’s theorem | (p − 1)! ≡ −1 (mod p), p prime |
| Corollary of Wilson | (p − 2)! ≡ 1 (mod p), p prime |