Proposition $5.2$, Section $2.3$ (Cyclic Groups) in Dummit and Foote's Abstract Algebra I'm trying to give an alternative proof of a proposition in Dummit and Foote's Abstract Algebra, but I am unable to complete the details. The proposition is:

\begin{align*}
\text{Let $G$ be a group, and let $x \in G$ and let $a \in \mathbb{Z} — \{0\}$.}  \; \text{If}  \; |x| = n < \infty, \; \text{then} \; |x^a| = \frac{n}{(n,a)}
\end{align*}

This is essentially Proposition 5.2 in section 2.3, Cyclic Groups and Cyclic Subgroups, on pp. 57. Here's my attempt:
Assume that $n \mid a$. Then $a = nk, k \in \mathbb{Z}$. Then. $x^a = x^{nk} = (x^n)^{k} = 1^k = 1$. Also noting that in this case $(n, a) = n$, we have that $|x^a| = 1 = n/(n,a)$.
Alternatively, assume that $n  \nmid a$. Then by the Divison Algorithm, we have that, $a = nq + r$, where $\; q, r \in \mathbb{Z}$ such that $0 < r < n$. Then, we have that,
\begin{align}
x^a = x^{nq + r} = x^{nq}x^r = (x^{n})^q x^r = 1(x^r) = x^r.
\end{align}
Assuming that $|x^a| = m$, we have that 
\begin{align}
(x^a)^m = x^{am} = x^{rm} = 1.
\end{align}
This implies that $n \mid rm$. Since $n \nmid r$, we then must have that $n \mid m$, using a result in elementary number theory, which I think I have been able to prove on the side. I'll skip the details on this front. 
I'm unable to proceed with the proof. I'm deliberately trying to prove the result without invoking/playing around with the expression given in the statement of the theorem. I'm trying to derive an expression, analogous to the one given in the statement of the theorem, using the Division Algorithm and divisibility theorems. I'm not so good with number theory, though.
Any hints?

It's not restrictive to assume $a>0$, as $|x^a|=|x^{-a}|$.
Let $y=x^a$. If $y^m=1$, then $n\mid am$, because $x^{am}=y^m=1$.
Conversely, if $n\mid am$, then $am=nq$ and
$$
y^m=x^{am}=x^{nq}=1
$$
In particular, $|y|$ is the minimal $m$ such that $n\mid am$.
If $d=\gcd(n,a)$, then $n=dn'$ and $a=da'$. Suppose $n\mid am$, so $am=nq$; then $da'm=dn'q$ and $a'm=n'q$. In particular $a'm=n'q$ is a common multiple of $a'$ and $n'$, hence a common multiple of $a'n'=\operatorname{lcm}(n',a')$, because $\gcd(n',a')=1$. Since $|y|$ is the minimal such $m$, we have $a'|y|=a'n'$. Therefore $|y|=n'=n/\gcd(n,a)$.
