Multiplicative Order

Idea · Intermediate

Number Theory

Let aa and nn be positive integers with

n>1,gcd⁡(a,n)=1.n>1,\qquad \gcd(a,n)=1.

The multiplicative order of aa modulo nn, denoted by

ord⁡n(a)\operatorname{ord}_n(a)

is the smallest positive integer kk such that

ak≡1(modn).a^k\equiv1\pmod n.

Such a positive integer always exists by Euler's theorem.

Example

Find ord⁡7(2)\operatorname{ord}_7(2).

We calculate:

21≡2(mod7),22≡4(mod7),23≡1(mod7).\begin{aligned}2^1&\equiv2\pmod7,\\2^2&\equiv4\pmod7,\\2^3&\equiv1\pmod7.\end{aligned}

Since 33 is the smallest positive exponent giving remainder 11,

ord⁡7(2)=3.\operatorname{ord}_7(2)=3.

Important Observation

If d=ord⁡n(a)d=\operatorname{ord}_n(a), then

a0,a1,…,ad−1a^0,a^1,\ldots,a^{d-1}

have distinct residues modulo nn, and the powers repeat with period dd.

In particular,

ak+d≡ak(modn)a^{k+d}\equiv a^k\pmod n

for every nonnegative integer kk.