Skip to content
Technique

Reduce a large power by the cycle of its base modulo

Arithmetic • Number System • Divisibility

Statement

For a fixed modulus and a base coprime to , the powers repeat modulo with some cycle length , where is the smallest exponent with . Writing then gives .

How to use it

  1. 1Reduce the base modulo first, then compute until reappears; that exponent is .
  2. 2Divide the exponent by and keep only the remainder ; a remainder of means .
  3. 3This works for a composite modulus, where Fermat's little theorem does not apply.

Worked example

What is the remainder when is divided by ?

Step-by-step

  1. 1
    , ,

    Why: The cycle closes at the third power, so .

  2. 2

    Why: Only the remainder of the exponent modulo matters.

  3. 3

Answer

Watch out

The base must be coprime to the modulus; if it shares a factor, the powers never return to and this fails. The cycle length divides Euler's but is often shorter, so it must be found rather than assumed.

Builds on

Also known as

order modulo n, power cycle mod n, remainder of a large power, cyclicity modulo a composite, reduce the exponent

Appears in past papers

2020 (II)

2019 (I)

2017 (I)