# Complex n-th root question

Let $m$ and $n\neq0$ be any two integers.Show that $z^{m/n}=\left(z^{1/n}\right)^m$ has $n/(n,m)$ distinct values, where $(n,m)$ is the greatest common divisor of $n$ and $m$. Prove that the sets of values of $(z^{1/n})^m$ and $(z^{m})^{1/n}$ coincide if and only if $n$ and $m$ are relatively prime.

For the first part as much as I know the $n$th root of $z^{m}$ would have n distinct values,which differ by $\frac{2km\pi}{n}$ in the argument where $k=0,1,...,n-1$. So supposing that $(n,m)=a$ I would get $$\frac{2k\frac{m}{a}\pi}{\frac{n}{a}},$$ where $k=0,1,2...,\frac{n}{a}-1$, but I am not sure how to finish this. I mean the second part.

-

Without loss of generality we take $|z| = 1$. Write $z$ in polar form as $z=e^{i\theta} = e^{i\theta + 2\pi ki}$. Then $$z^{\frac{1}{n}} = \exp\left(\frac{i\theta}{n} + \frac{2\pi ki}{n}\right)$$ $$z^{\frac m n} = \exp\left(\frac{im\theta}{n} + \frac{2m\pi ki}{n}\right)$$ as $k$ ranges through the integers, the value repeats itself if and only if $\frac{2m\pi k}{n}$ becomes a multiple of $2\pi$. This happens if and only if $\frac{mk}{n}$ is integral. If we let $d=\gcd(m,\ n)$ and write $m = m'd,\ n=n'd$ then $$\frac{mk}{n} = \frac{m'k}{n'}$$ so that the exponents complete a full cycle of values whenever $$k\equiv 0\pmod{n'}$$ so that there are precisely $n' = \frac n d$ distinct values of $z^{\frac m n}$
For the second part, consider the difference in the two expressions $$\left(z^{\frac 1 n}\right)^m = \exp\left(\frac{im\theta}{n} + \frac{2m\pi ki}{n}\right)$$ and on the other hand $$\left(z^{m}\right)^{\frac 1 n} = \left[\exp\left(im\theta + 2km\pi i\right)\right]^{\frac 1 n} = \left[\exp\left(im\theta + 2k\pi i\right)\right]^{\frac 1 n} = \exp\left(\frac{im\theta}{n} + \frac{2k\pi i}{n}\right)$$ Notice that the second expression takes on different values as $k$ ranges through $$k \equiv 0, 1,\ 2, \cdots, n-1 \pmod n$$ If the first set takes on corresponding values, that means $mk\pmod n$ must be a rearrangement of the residues $0,\ 1,\ cdots,\ n-1$. In particular, this means that the linear congruence $$mk \equiv 1 \pmod{n}$$ has a solution for $k$ so that $\gcd(m, n)$ must divide $1$ by the linear congruence theorem. Conversely, if $m$ and $n$ are coprime, then $$mk \equiv mk'\pmod{n} \implies k\equiv k'\pmod{n}$$ so that the former ranges through the entire residue classes of the latter and hence takes on the same set of $n$ values.