Modular arithmetic is a system of operations for integers where numbers "wrap around" when they reach a certain value, called the modulus.
Given an integer
The parentheses mean that
Occasionally, the parentheses are omitted (ie.
Formally, two integers
Alternatively, this can be written as:
The fundamental theorem of modular arithmetic means that it doesn’t matter if you do a sequence of operations, and then take the remainder
Formally the fundamental theorem of modular arithmetic is stated as follows:
If
and mod m then .