Modular Arithmetic Example
Modular arithmetic works with remainders after division by a fixed positive integer called the modulus. This example adds 38 and 27 modulo 7 by reducing each number first, then verifies the result using the full sum.
Find (38 + 27) mod 7.
The notation a ≡ b (mod n) means that a and b have the same remainder when divided by n. Reduce the addends modulo 7 before adding.
| Modulus | 7 |
|---|---|
| First addend reduced modulo 7 | 38 leaves remainder 3 |
| Second addend reduced modulo 7 | 27 leaves remainder 6 |
| Expected remainder | 2 |
Step-by-step solution
- 1
Reduce the first number
Divide 38 by 7. Since 7 × 5 = 35, the remainder is 3.
- 2
Reduce the second number
Divide 27 by 7. Since 7 × 3 = 21, the remainder is 6.
- 3
Add the remainders
Congruent values can be added while preserving the modulus. The sum of the remainders is 9, which leaves remainder 2 when divided by 7.
- 4
State the least nonnegative residue
The standard remainder is the unique value from 0 through 6 congruent to the sum modulo 7.
ANSWER
The remainder is 2
The sum 65 is congruent to 2 modulo 7 because subtracting 63, a multiple of 7, leaves 2.
Check with direct division
Divide the original sum by the modulus. The quotient is 9 and the remainder is 2, matching the reduced calculation.