Prove that $$\mathrm{Aut}\ \mathbb{Z}_{2^n}=\mathbb{Z}_2\times \mathbb{Z}_{2^{n-2}}$$ $$\mathrm{Aut}\ \mathbb{Z}_{p^n}=\mathbb{Z}_{p^{n-1}(p-1)}$$
I figured out that $\mathrm{Aut}\ \mathbb{Z}_n=U(\mathbb{Z}_n)$ and $\lvert U(\mathbb{Z}_n) \rvert=\varphi(n)$, where $\varphi$ is the Euler's totient function, how should I go on?