I am a graduate student of Mathematics. I have a course on number theory. Our professor told us a result that $U_n$ is cyclic iff $n=1,2,4,p^k,2p^k$ for $p$ odd prime. But I cannot find any easy proof of the result. This question is answered in stack exchange but the answer is without any explanation: For what $n$ is $U_n$ cyclic?
The answer says $U_{2^k}=\mathbb Z_2\times \mathbb Z_{2^{k-2}}$ for $k\geq 2$ and $U_{p^k}=\mathbb Z_{\phi(p^k)}$ which are beyond my understanding due to lack of explanation.
Can someone help me by providing a complete easy proof of this result using algebra?