Mathematics - Number Theory - Modular arithmetic - Modular Arithmetic
10 steps: (1) a ≡ b (mod n) means n divides (a-b). Equivalently, a and b have same remainder when divided by n. (2) 17 ≡ 2 (mod 5) because 17-2=15=3×5. (3) ADDITION: (a+b) mod n = [(a mod n)+(b mod n)] mod n. (4) MULTIPLICATION: (a×b) mod n = [(a mod n)×(b mod n)] mod n. (5) Example: 7×8 mod 5 = (2)