Suppose that $\rm\:a\:$ has order $\rm\:n\:.\:$ To compute the order of $\rm\:a^i\:$ one may proceed efficiently as follows
$\rm a^{i\:k} = 1\ \iff\ n\ |\ i\:k\ \iff\ n\ |\ i\:k,\:n\:k\ \iff\ n\ |\ (i\:k,n\:k) = (i,n)\:k\ \iff\ n/(i,n)\ |\ k$
Therefore $\rm\:a^i\:$ has order $\rm\:n/(i,n)\:.\:$
Note especially how this method efficiently simultaneously proves both directions of the proof by exploiting the universal bidirectional $(\iff)$ definition of the $\rm gcd,$ namely $\rm\ a\ |\ b,c\ \iff\ a\ |\ (b,c)\:.\:$ Contrast this with standard proofs (e.g. other answer) which prove each direction separately.