Number Theory - Primitive roots Let $n$ be positive integer.
$G$ is cyclic and finite group generated by $g$.
I need to prove that for every positive integer $k$ :
$$O(g^k) = \frac{n}{\gcd(n,k)}$$
I don't really know what to do here. I know that if $G$ generated by $g$ so for $g^k$, $\gcd(k,n)=1$ and from the order there is $x$ so $o((g^k)^x)=1_G$ but what can I do from here??
 A: There are two things to do. You need to show that (i) $g^k$ raised to the power $n/\gcd(n,k)$ is the identity and (ii) nothing cheaper will work.
Doing (i) is a calculation. Let $n=n_1 d$ and $k=k_1 d$.
For (ii), suppose that $(g^k)^i$ is the identity. Then $n$ divides $ki$, and therefore $n_1$ divides $k_1 i$. Conclude from this that $k$ divides $i$, and you are close to the end.
A: There is a more general setting:

Let $G$ be a group, and $a\in G$ be an element of finite order, say $|a|=m$. Then for every $n$, we have that $$|a^n|=\frac{m}{(m,n)}$$

Intuitively, you can think the following: $m$ is the least positive integer for which $a^m=e$. It might be very well the case that $n$ shares factors with $m$. In that case, $a^n$ is will need less factors of $m$ to get to $e$. The $(m,n)$ part is simply taking out those common factors, and saying all that needs to be done is add the missing ones, which are in $m/(m,n)$. Now, the proof can go as follows:
P We have that
$$nk\equiv 0\mod m\iff  \frac{nk}{(m,n)}\equiv 0\mod \frac{m}{(m,n)} $$
We have that $a^{nk}=e$ if and only if $nk=0\mod m$. Thus, consider the set $$A=\{k\in\Bbb Z:nk\equiv 0\mod m\}$$
By the above, it is equal to the set
$$A'=\left\{k\in\Bbb Z:\frac{m}{(m,n)}\mid \frac{n}{(m,n)}k\right\}$$
But since $\frac{m}{(m,n)}$ and $\frac{n}{(m,n)}$ are coprime, this is the same set as 
$$A''=\left\{k\in\Bbb Z:\frac{m}{(m,n)}\mid  k\right\}=\left\{k\frac{m}{(m,n)}:k\in\Bbb Z\right\}$$
The order of $a^n$ will be the least positive integer in $A=A'=A''$. It is immediate this is $\frac{m}{(m,n)}$ 
