Mathyessy
Home › Topics › Number Theory › Modular arithmetic

Modular arithmetic practice

Modular arithmetic is arithmetic with remainders. It turns giant calculations into small ones.

How it works

We write a ≡ b (mod m) when a and b leave the same remainder when divided by m. Clock time is mod 12: 3 hours after 11 o'clock is 2 o'clock.

The big idea: you may replace any number by its remainder before adding, subtracting or multiplying. To find 123 × 456 mod 7, reduce first (123 ≡ 4 and 456 ≡ 1), so the answer is 4 × 1 = 4. No big multiplication needed.

For powers, find a small power that is ≡ 1, then use it to cut down the exponent. Since 2³ = 8 ≡ 1 (mod 7), powers of 2 mod 7 repeat every 3. Negative remainders help too: 7 ≡ −1 (mod 8), so 7even ≡ 1 and 7odd ≡ 7.

Modular Arithmetic practice problems with solutions

These problems come from Mathyessy's question bank. Try each one before opening the solution.

  1. What is 23 times 17 mod 11?

    Show answer and solution

    Answer: 6

    Reduce first: 23 ≡ 1 and 17 ≡ 6 (mod 11). So the product is ≡ 1 × 6 = 6. (Check: 391 = 35 × 11 + 6.)

  2. What is 2 to the power 100 mod 7?

    Show answer and solution

    Answer: 2

    2³ = 8 ≡ 1 (mod 7), so the powers repeat every 3. 100 = 3 × 33 + 1, so 2¹⁰⁰ = (2³)³³ × 2 ≡ 1 × 2 = 2.

  3. What is the smallest positive x so that 7 times x is 1 mod 11?

    Show answer and solution

    Answer: 8

    Try multiples of 7 until one is 1 more than a multiple of 11: 7, 14, 21, 28, 35, 42, 49, 56. 56 = 55 + 1, so x = 8.

  4. What is 123 times 456 mod 7?

    Show answer and solution

    Answer: 4

    123 = 119 + 4, so 123 ≡ 4. 456 = 455 + 1, so 456 ≡ 1. The product is ≡ 4 × 1 = 4.

Practice this in Mathyessy →Free, no account needed. Opens the Modular Arithmetic set with instant feedback.

Keep going

Related topics

Related practice sets in the app

All Number Theory topics · Contest math practice by topic · MATHCOUNTS practice · AMC 8 practice