Mobius function of product of primes We have the arithmetic function $$f(n)=\sum_{d\mid n}\mu (d)\cdot d$$ I want to show that $f\left (p_1^{e_1}\cdots p_k^{e_k}\right )=(-1)^k\cdot (p_1-1)\cdots (p_k-1)$. 
We have that $d$ is of the form $p_1^{a_1}\cdots p_k^{a_k}$ with $0\leq a_i\leq e_i$ right? 
So $$f\left (p_1^{e_1}\cdots p_k^{e_k}\right )=\sum_{d\mid n}\mu (d)\cdot d=\sum_{0\leq a_i\leq e_i, \forall i}\mu (p_1^{a_1}\cdots p_k^{a_k})\cdot p_1^{a_1}\cdots p_k^{a_k}$$ or not? 
How could we continue? 
 A: Yes, you are correct so far. Now  by the multiplicative property of the Mobius function and its definition, it follows that
$$\begin{align*}\sum_{0\leq a_i\leq e_i, \forall i}\mu (p_1^{a_1}\cdots p_k^{a_k})\cdot p_1^{a_1}\cdots p_k^{a_k}&=
\sum_{0\leq a_i\leq e_i, \forall i}\mu (p_1^{a_1})\cdots \mu(p_k^{a_k})\cdot p_1^{a_1}\cdots p_k^{a_k}\\&=
\sum_{0\leq a_i\leq 1, \forall i}(-1)^{a_1}\cdots (-1)^{a_k}\cdot p_1^{a_1}\cdots p_k^{a_k}\\&=
\sum_{0\leq a_1\leq 1}(-p_1)^{a_1}\dots\sum_{0\leq a_k\leq 1}\cdots (-p_k)^{a_k}\\&=(1-p_1)\cdots(1-p_k)\\
&=(-1)^k\cdot (p_1-1)\cdots (p_k-1).\end{align*}$$
A: A little more general:
Theorem: Suppose $f$ is a multiplicative function. Then $$\sum_{d|n} \mu(d) f(d) = \prod_{p|n} (1-f(p)).$$
Proof: Let $$g(n) = \sum_{d|n} \mu(d) f(d).$$ Then $g$ is multiplicative (the product $\mu f$ is obviously multiplicative so the Direchlet convolution $\mu f * u$ where $u(n) = 1$ for every $n$ is multiplicative). This implies that $g$ is completely determined by its behavior on powers of primes. 
That is, $$g(p^k) = \sum_{d|p^k} \mu(d) f(d) = \mu(1) f(1) + \mu(p) f(p) = 1-f(p).$$ Therefore, $$g(n) = \prod_{p|n}g(p^k) = \prod(1-f(p)).$$
Note: Try to deal with the prime powers individually rather than dealing with all of them at once. That is, try handling the case where $n = p^k$ first and then apply the multiplicative property to attain the general case. 
