Modular exponentiation

Use this to find a power's remainder without expanding the full integer.

0/5 marked as readthis browser

What’s happening here?

Large powers can be reduced along the way without changing their final remainder. Repeated squaring builds powers efficiently, and a binary decomposition tells you which of them to multiply.

KEEP THIS RELATIONSHIP

Reduce each intermediate product modulo the same positive modulus. Combine powers using ordinary exponent rules.

A worked example.

Find the nonnegative remainder of 3133^{13} modulo 7.
  1. 1

    Square and reduce: 32≡23^2\equiv2, 34≡43^4\equiv4, and 38≡2(mod7)3^8\equiv2\pmod7.

  2. 2

    Write 13=8+4+113=8+4+1, so 313=38⋅34⋅33^{13}=3^8\cdot3^4\cdot3.

  3. 3

    Multiply the remainders: 2⋅4⋅3=24≡3(mod7)2\cdot4\cdot3=24\equiv3\pmod7. The requested remainder is 3.

A common wrong turn.

Adding exponents corresponds to multiplying powers, not adding their remainders. Keep the modulus unchanged throughout the calculation.

Why this works.

Congruence respects multiplication, so reducing after each multiplication preserves the final remainder. Repeated squaring computes large powers using only a few small residues. A repeating pattern can shorten the work further, but establish the pattern before using it.

Check it. Apply it. Explain it.

Three questions, with hints and worked feedback. Your score counts your first submitted answer. Practice only · scores stay in this session and do not enter your account history.

Question 1 of 30 correct / 0 answered

Modular exponentiation

What is the nonnegative remainder of 2¹⁰ modulo 7?

Videos and further reading

These resources open in a new tab on the publisher’s website.

Finished reading?Stored in this browser; separate from practice grades.

Put the idea to work.

Try the three-question practice above, then bring a related problem to the AI Solver for an explained solution.

Open AI Solver