\[n=p_1^{k_1}p_2^{k_2}...p_r^{k_r}\]
then \[n^2=p_1^{2k_1}p_2^{2k_2}...p_r^{2k_r}\]
, where \[\phi (n)\]
is the number of integers less than or equal to \[n\]
which are relatively prime to \[n\]
.\[\begin{equation} \begin{aligned} \phi (n^2) &= \phi (p_1^{2k_1}p_2^{2k_2}...p_r^{2k_r}) \\ &= \phi (p_1^{2k_1}) \phi (p_2^{2k_2}) ... \phi (p_r^{2k_r}) m(1)) \\ &= p_1^{2k_1-1} (p_1-1)p_2^{2k_2-1} (p_2-1)... p_r^{2k_r-1} (p_r-1) \\ &= (p_1^{k_1}p_2^{k_2}...p_r^{k_r}) (p_1^{k_1-1}(p_1-1)p_2^{k_2-1}(p_2-1)...p_r^{k_r-1}(p_r-1)) \\ &= n \phi (n) \end{aligned} \end{equation}\]
.(1) is used since
\[\phi (ab)= \phi (a) \phi (b)\]
whenever \[a, \; b\]
are relatively prime.Also since
\[\phi (p^k)=p^{k-1}(p-1)\]
then\[\begin{equation} \begin{aligned} \phi ( \phi (p^k)) &= \phi (p^{k-1}(p-1)) \\ &= \phi (p^{k-1}) \phi (p-1) \\ &= p^{k-2}(p-1) \phi (p-1) \\ &= p^{k-2} \phi ((p-1)^2) \end{aligned} \end{equation}\]
on using the first result.