Integer has Multiplicative Order Modulo n iff Coprime to n

Theorem
Let $a$ and $n$ be integers.

Let the order of $a$ modulo $n$ exist.

Then $a \perp n$, that is, $a$ and $n$ are coprime.

Proof
By definition, if $c \in \Z_{>0}$ is the order of $a$ modulo $n$, then:


 * $a^c \equiv 1 \pmod n$

Hence, by definition, $a^c = k n + 1$ for some $k \in \Z$.

Thus:


 * $a r + n s = 1$

where $r = a^{c-1}$ and $s = -k$.

The result follows from Integer Combination of Coprime Integers.