Show that $\phi(mn) = \phi(m)\phi(n)\frac{d}{\phi(d)}$ [duplicate]

Possible Duplicate:
Proof of a formula involving Euler's totient function.

For positive integers $m$ and $n$ where $d=gcd(m,n)$, show that $$\phi(mn) = \phi(m)\phi(n)\frac{d}{\phi(d)}$$

This is just the generalization of the multiplicative property of phi function.I have tried to solve this in the same way as the proof of multiplicative property but couldn't get far.Please help.


Solution 1:

Suppose $$d=q_1^{\gamma_1}\cdot\ldots\cdot q_k^{\gamma_k}\,,\,m=d\cdot p_1^{\alpha_1}\cdot\ldots\cdot p_r^{\alpha_r}\,,\,n=d\cdot t_1^{\beta_1}\cdot\ldots\cdot t_s^{\beta_s}$$with $\,p_i\,,\,q_i\,,\,t_i\,$ primes , $\,\alpha_i\,,\,\beta_i\,,\,\gamma_i\in\mathbb{N}\,$ . Then, we have$$\varphi(mn)=mn\prod_{i=1}^r\left(1-\frac{1}{p_i}\right)\prod_{j=1}^s\left(1-\frac{1}{t_j}\right)\prod_{l=1}^k\left(1-\frac{1}{q_l}\right)$$$$\varphi(m)=m\prod_{i=1}^r\left(1-\frac{1}{p_i}\right)\,,\,\varphi(n)=n\prod_{j=1}^s\left(1-\frac{1}{t_j}\right)$$$$\varphi(d)=d\prod_{l=1}^k\left(1-\frac{1}{q_l}\right). $$The wanted equality follows at once.