Modular Arithmetic
Remember “clock arithmetic”?
If Mildred says she’ll be home by 10:00 and she’s 13 hours late, what time does she get home and for how many years does her father ground her? => arithmetic modulo 12.
(10 + 13) mod 12 = 23 mod 12 = 11 mod 12
a = b (mod n) if a = b + k n for some integer k
<=> a is congruent to b, modulo n
<=> b is the residue of a, modulo n
<=> a non-negative, 0 <= b<= n => b is remainder of a