What is modular arithmetic, as in 5 (mod 7)?
When you first learn to divide, we would say “6 goes into 27 4 times with remainder 3” which is another way to say 27=6×4+3. Then we start learning fractions and the remainder becomes the numerator of the mixed fraction 27/6= 43/6 before we reduce the fraction to lowest terms as 4½. In some parts of higher math, we go back to taking remainders when dividing; in fact, we split up all the integers into separate sets (known as disjoint sets) based on what the remainder is when we divide by some integer n > 1. This would be written as 27 3 (mod 6) or in some books it is written as 27 = 3 (mod 6). When we write a b (mod c), this means that the positive number c divides (a-b), written as c|(a-b) or c = k(a-b) where k is an integer. In our example above, 27 = 3 (mod 6) because 6|(27-3), which means 27-3 = 24 = 4×6. By splitting all the integers into six disjoint sets, we can say that a (mod 6) represents an infinite set as follows. 0 (mod 6) = {…,-12, -6, 0, 6, 12, …} 1 (mod 6) = {…,-11, -5,