Two integers are congruent modulo , written , if they leave the same remainder when divided by (equivalently, ). This relation is reflexive, symmetric, and transitive — it behaves like equality, which is what makes it so useful.
What you can and can’t do
Addition, subtraction, and multiplication are all safe under a fixed modulus: if and , then , , and, all still modulo . Division is the exception — has a modular inverse mod (an element with) if and only if .
Reducing large powers
For computing with a huge exponent, look for the point where the powers of start repeating (the multiplicative cycle). Once you know the cycle length, reduce the exponent modulo that length before computing.
Worked example
Problem: Find the remainder when is divided by 7.
Solution: Compute powers of 3 mod 7 until they repeat:
The cycle length is 6 (as guaranteed by Fermat’s Little Theorem, since 7 is prime). Reduce the exponent: , so .
Practice problems
1.Find and (using the convention that a remainder is nonnegative).
2.Does 4 have a modular inverse mod 15? If so, find it.
3.Find the remainder when is divided by 9.
4.Find the last digit of .