Proving that $\sum \limits_{d^2|n}\ \mu (d)=\mu^2(n)$, where $\mu$ is the Möbius function. [closed]

Let $\mu$ be the Möbius function. Then prove that $\sum \limits_{d^2|n}\ \mu (d)=\mu^2(n)$, and more generally $$ \sum \limits_{d^k|n}\ \mu (d) = \begin{cases} 0 &\text{if } m^k \mid n \\ 1 &\text{otherwise.} \end{cases}$$


Since $\mu$ is multiplicative, you need only show this for prime powers. So you want to show the pair $$ \sum_{d^2 \mid p} \mu(d) = 1,$$ which is trivial, and $$ \sum_{d^2 \mid p^k} \mu(d) = 0$$ for $k \geq 2$, which is easy once you realize how easy it is to describe the square factors of prime powers. This methodology holds similarly for more general powers instead of squares.


Here is a proof using Dirichlet series. Observe that $$\sum_{n\ge 1}\frac{\mu(n)}{n^{ks}} = \frac{1}{\zeta(ks)}.$$

Therefore $$L(s) = \sum_{n\ge 1}\frac{\sum_{d^k|n}\mu(d)}{n^{s}} = \frac{\zeta(s)}{\zeta(ks)}.$$

This has Euler product $$L(s) = \prod_p \frac{1-1/p^{ks}}{1-1/p^s}.$$

Note that this is $$\prod_p \left(1+\frac{1}{p^s}+\frac{1}{p^{2s}}+\cdots + \frac{1}{p^{(k-1)s}}\right).$$

It now follows by inspection that $$L(s) = \sum_{n\ge 1} \frac{[[\not\exists m^k|n]]}{n^s}.$$