Originally Posted by

**Drexel28** We kind of need this lemma

__Lemma:__ Let $\displaystyle g\in G$ with $\displaystyle |g|=n$. If $\displaystyle g^{m}=e$ then $\displaystyle n|m$.

__Proof:__ By the division algorithim $\displaystyle m=qn+r\quad q\in\mathbb{Z},0\le r<n$. So then $\displaystyle g^m=g^{qn+r}=\left(g^n\right)^qg^r=g^r=e$ and since $\displaystyle 0\le r<n$ and $\displaystyle n$ is the least positive integer such that $\displaystyle g^k=e$ we must have that $\displaystyle r=0$. Therefore $\displaystyle m=qn\quad q\in\mathbb{Z}$ and the conclusion follows. $\displaystyle \blacksquare$

So basically we need the least number $\displaystyle k$ such that $\displaystyle n|mk$, i.e. we need $\displaystyle \left|a^m\right|=\text{lcm}(m,n)$