Show that $\sum_{z=1, \, z|n}^n z^2 \mu(z/n) = n \phi(n) \prod_{p|n} \left( 1+\frac{1}{p} \right)$ Show that $$\sum_{z=1, \, z|n}^n z^2 \mu(z/n) = n \phi(n) \prod_{p|n} \left( 1+\frac{1}{p} \right).$$
I have no idea how to show this. I tried different things for few hours and now Im out of ideas really..
Here $\mu(z)$ is möbius function and $\phi(z)$ is euler's totient.
 A: In the following we assume that $$n=\prod_{p|n} p^v$$ is the prime factorization of $n$ and use the Euler product
$$\zeta(s)=\prod_p \frac{1}{1-1/p^s}.$$
The Dirichlet series for the left is a convolution of
$$\sum_{q\ge 1} \frac{q^2}{q^s} = \zeta(s-2)
\quad\text{and}\quad
\sum_{q\ge 1} \frac{\mu(q)}{q^s} = \frac{1}{\zeta(s)}.$$
Therefore this Dirichlet series is
$$\frac{\zeta(s-2)}{\zeta(s)}.$$
On the other hand the right is
$$n^2 \prod_{p|n} \left(1-\frac{1}{p^2}\right)
= \prod_{p|n} \left(1-\frac{1}{p^2}\right) p^{2v}.$$
The Euler product here is
$$\prod_p \left(1+\left(1-\frac{1}{p^2}\right) \sum_{q\ge 1}\frac{p^{2q}}{p^{qs}}\right)$$
or $$\prod_p \left(1+\left(1-\frac{1}{p^2}\right) 
\frac{1/p^{s-2}}{1-1/p^{s-2}}\right)$$
which is
$$\prod_p \frac{1}{1-1/p^{s-2}}
\prod_p \left(1-\frac{1}{p^{s-2}} + \frac{1}{p^{s-2}}-\frac{1}{p^s}\right)
\\ = \prod_p \frac{1}{1-1/p^{s-2}}
\prod_p \left(1-\frac{1}{p^s}\right).$$
This simplifies to the Dirichlet series $$\frac{\zeta(s-2)}{\zeta(s)}.$$
The LHS is the same as the RHS, done.
Remark I. The equation $$\sum_{q\ge 1} \frac{\mu(q)}{q^s} = \frac{1}{\zeta(s)}$$ follows from the Euler product $$\sum_{q\ge 1} \frac{\mu(q)}{q^s} = \prod_p \left(1-\frac{1}{p^s}\right).$$
Remark II. The simplification of the RHS follows from
$$\varphi(n) = n \prod_{p|n} \left(1-\frac{1}{p}\right).$$
A: Theorem: If $f$ is multiplicative and $F$ is the summatory function of $f$, then$$
f(n) = \sum_{z\mid n} \mu(n/z)F(z).$$
Let $\displaystyle f(n) = n\phi(n)\prod_{p\mid n}\left(1+\frac{1}{p}\right) = \prod_{p\mid n}p^{2e}-p^{2e-2}$; $e$ is the largest power of prime $p$ dividing $n$.
Then $\displaystyle F(n) = \sum_{z\mid n}\prod_{p\mid z}p^{2k}-p^{2k-2}$ where $k$ is the largest power of $p$ that divides $z$. So $1\le k\le e$.
The result will follow from the theorem above if $F(n) = n^2$.
Let $n=p_1^{e_1}p_2^{e_2}\dots p_r^{e_r}$, and 
$$
\begin{align*}
n^2 &= p_1^{2e_1}p_2^{2e_2}\dots p_r^{2e_r} =\prod_{1\le i\le r}p_i^{2e_i} \\
&= \prod_{1\le i\le r}(1+(p_i^2-1)+(p_i^4-p_i^2)+\dots +(p_i^{2e_i}-p_i^{2e_i-2})).
\end{align*}
$$
If the last product is expanded, it gives the sum of $1$ ($1\mid n$) and all possible products
$\displaystyle\prod_{} p^{2k}-p^{2k-2}$, which is exactly the same as $\displaystyle F(n) = \sum_{z\mid n}\prod_{p\mid z}p^{2k}-p^{2k-2}$. Maybe someone can please help me explain this better.
