3.7 Modular arithmetic
There are an infinite number of integers and hence rationals and real numbers. Are there sets of numbers that behave somewhat like them but are finite? number$modular integer integer$modular
Consider the integers modulo 6: {0, 1, 2, 3, 4, 5}. We write 3 mod 6 when we consider the 3 in this collection. Given any integer n, we can map it into this collection by computing the remainder modulo 6. We do arithmetic in the same way: modulo
Instead of “=”, we write “≡”. We say that a is congruent to b mod 6 when we see a ≡ b mod 6, which means a – b is evenly divisible by 6: 6 | (a – b). congruent
These six elements form a group under addition with identity 0. In the last example, 2 is the additive inverse of 4. We denote this group Z/6Z.
Exercise 3.22
What is –1 mod 6? For n a natural number greater than 1, what is –1 mod n?
...