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.
Reduce each intermediate product modulo the same positive modulus. Combine powers using ordinary exponent rules.
A worked example.
- 1
Square and reduce: , , and .
- 2
Write , so .
- 3
Multiply the remainders: . 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.
Modular exponentiation
Videos and further reading
The discrete logarithm problem: modular powers
www.khanacademy.org · New tabModular exponentiation
en.wikipedia.org · New tabThese resources open in a new tab on the publisher’s website.
Finished reading?Stored in this browser; separate from practice grades.