Congruences modulo n: a ≡ b [n] if a and b share a remainder
17 ≡ 5 [12] since 17 = 12 + 5. A cyclic arithmetic simplifying divisibility and cryptography.
Definition
is congruent to modulo if is divisible by :
Equivalently: and have the same remainder in division by .
Examples
- (since ).
- (since ).
- (useful for clock time!).
Operations: preserved
If and :
- Addition:
- Subtraction:
- Multiplication:
- Power:
⚠️ Division is not always possible!
Application 1: divisibility rule
To test if is divisible by : sum of digits.
Why? Because , so . A number is congruent to the sum of its digits mod 9.
Application 2: huge remainder
Compute mod 5.
.
, so .
Remainder = 1.
Application 3: day of week
Today = Wednesday. In 100 days?
, so . Wednesday + 2 = Friday.
Fermat’s little theorem
If is prime and not divisible by :
Use: simplify powers modulo a prime.
Common mistakes
- Dividing in a congruence without with .
- Writing when isn’t divisible by .
- Forgetting remainders are non-negative ().
46 mod 7 = ?
Mini-quiz
Question 1 / 373 mod 5 = ?
