I am trying to understand the following: $$g^a \equiv 1 \pmod m \quad \text{and} \quad g^b \equiv 1 \pmod{m} \quad \implies \quad g^{\gcd(a,b)} \equiv 1 \pmod{m}.$$
I have tried a few approaches, but I can't seem to find one that works out.
I am trying to understand the following: $$g^a \equiv 1 \pmod m \quad \text{and} \quad g^b \equiv 1 \pmod{m} \quad \implies \quad g^{\gcd(a,b)} \equiv 1 \pmod{m}.$$
I have tried a few approaches, but I can't seem to find one that works out.
On
Hint:
Let $c$ be the smallest positive integer so that $g^c\equiv 1 \pmod m$.
You can prove that if $g^d \equiv 1 \pmod m$ then $c|d$.
Use integer division of $d$ by $c$: $d = qc+r$ with $0 \leq r < c$. Since $g^d \equiv g^c \equiv 1 \pmod m$ then $g^{d-qc} \equiv 1 \Rightarrow g^r \equiv 1$ but $c$ was the smallest positive number so that $g^c \equiv 1$, therefore $r = 0$.
That would mean that $c|a$ and $c|b$, so $c|\gcd(a,b)$, and therefore $g^{\gcd(a,b)} \equiv g^{ck} \equiv 1^k \equiv 1\pmod m$
By Bézout's identity, there exists a pair of integers $(p,q)$ such that $p a+q b=\gcd(a,b)$.
We then get the following:
EDIT: There is also the following straight forward argument if you don't know of Bézout's theorem: