I’ve already presented and proved the rule for modular addition, so for a sense of completeness, but mostly to satisfy my OCD, now I’ll cover the rule for modular subtraction. When doing subtraction in modular arithmetic, the rule is:

If we subtract integer from integer and calculate the difference modulo , we get the same answer as if we had subtracted modulo from modulo and then calculated that difference modulo . Like the modular addition rule, this rule can also be expanded to include multiple integers. Continue reading »