Order as the exact period of modular exponentiation (source code)

= Order as the exact period of modular exponentiation

Equality $a^x\equiv a^y\pmod N$ holds exactly when the multiplicative order divides $x-y$, so one period contains no repeated values.