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.

(38+27) mod 7=?(38+27)\bmod7=?
Key facts used in this example
Modulus7
First addend reduced modulo 738 leaves remainder 3
Second addend reduced modulo 727 leaves remainder 6
Expected remainder2

Step-by-step solution

  1. 1

    Reduce the first number

    Divide 38 by 7. Since 7 × 5 = 35, the remainder is 3.

    38=7⋅5+3⇒38≡3(mod7)38=7\cdot5+3\quad\Rightarrow\quad38\equiv3\pmod7
  2. 2

    Reduce the second number

    Divide 27 by 7. Since 7 × 3 = 21, the remainder is 6.

    27=7⋅3+6⇒27≡6(mod7)27=7\cdot3+6\quad\Rightarrow\quad27\equiv6\pmod7
  3. 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.

    38+27≡3+6=9≡2(mod7)38+27\equiv3+6=9\equiv2\pmod7
  4. 4

    State the least nonnegative residue

    The standard remainder is the unique value from 0 through 6 congruent to the sum modulo 7.

    (38+27) mod 7=2(38+27)\bmod7=2

ANSWER

The remainder is 2

The sum 65 is congruent to 2 modulo 7 because subtracting 63, a multiple of 7, leaves 2.

38+27=65=7⋅9+2⇒65≡2(mod7)38+27=65=7\cdot9+2\quad\Rightarrow\quad65\equiv2\pmod7

Check with direct division

Divide the original sum by the modulus. The quotient is 9 and the remainder is 2, matching the reduced calculation.

65÷7=9 remainder 265\div7=9\text{ remainder }2