Prove that if $\gcd(𝑚, 𝜑(𝑛)) = 1$ and $a^m\equiv 1\pmod{n}$ then $a\equiv 1\pmod{n}$

modular arithmetictotient-function

Prove that if $$\gcd(𝑚, 𝜑(𝑛)) = 1$$ and $$a^m\equiv 1\pmod{n}$$ then $$a\equiv 1\pmod{n}$$ given that
$$\text{gcd}(a,n) = 1 \quad( a, n , m ∈ ℕ )$$

I know how to explain the opposite way but I didn't reach any conclusion about this one.

Please help, thanks.

Best Answer

If $\gcd(m,\varphi(n))=1$ then there are integers $x,y$ such that $mx+\varphi(n)y=1$. Now write $$a=a^{mx+\varphi(n)y}=(a^m)^x(a^{\varphi(n)})^y$$ and use $a^m\equiv 1\pmod{n}$ (hypothesis) and $a^{\varphi(n)}\equiv 1\pmod{n}$ (Euler's theorem).