The application of basic arithmetic to finite systems of whole numbers.
In the system modulo n or a restricted system of whole numbers less than n, we use the numbers 0, 1, 2, 3, 4, …, (n – 1).
The arithmetic operations defined in this system are the same as those in basic arithmetic, except that the numbers used cannot be greater than (n – 1). When a result should be greater than (n – 1), we divide this result by n and we use the remainder of this division as the result of the operation.
Example
Here is a multiplication table of the numbers in the set {0, 1, 2, 3, 4} in arithmetic modulo 5:
× | 0 | 1 | 2 | 3 | 4 |
0 | 0 | 0 | 0 | 0 | 0 |
1 | 0 | 1 | 2 | 3 | 4 |
2 | 0 | 2 | 4 | 1 | 3 |
3 | 0 | 3 | 1 | 3 | 2 |
4 | 0 | 4 | 3 | 2 | 1 |