TITLE: Prove $\sum_{k\mid n}{\mu(k)d(k)}=(-1)^{\omega{(n)}}$
QUESTION [5 upvotes]: I have the following exercise. 

Show that for all natural numbers $n$, the following equality holds
  $$\sum_{d|n}{\mu{(d)}d(d)}=(-1)^{\omega{(n)}}$$
  Here, $\mu$ is the Möbius function, $d$ counts the number of divisors of $n$, and $\omega$ counts the number of distinct prime divisors of $n$.

I tried looking at a number like $n=10$ just to see what it looks like expanded.  So since the divisors of $n$ are $1,2,5,$ and $10$, I can show that 
$$\sum_{d|10}{\mu{(d)}d(d)}=(-1)^{\omega{(10)}}=\mu(1)d(1)+\mu(2)d(2)+\mu(5)d(5)+\mu(10)d(10)=1$$
This gives me
$$1\cdot 1+-1\cdot 2+-1\cdot 2 +1\cdot 4 $$
I'm thinking somehow since both $\mu$ and $d$ are multiplicative that we can rewrite though as 
$$\mu(1)d(1)+\mu(2)d(2)+\mu(5)d(5)+\mu(2)d(2)\mu(5)d(5)$$
$$=\mu(1)d(1)+\mu(5)d(5)+\mu(2)d(2)+\mu(2)d(2)\mu(5)d(5)$$
$$=\mu(1)d(1)+\mu(5)d(5)+\mu(2)d(2)(1+\mu(5)d(5))$$
$$=\mu(1)d(1)+\mu(5)d(5)+\mu(2)d(2)(\mu(1)d(1)+\mu(5)d(5))$$
$$=(1+\mu(2)d(2))(1+\mu(5)d(5))$$
$$=\sum_{d|2}{\mu(d)d(d)}\sum_{d|5}{\mu(d)d(d)}$$
So this original summation function is multiplicative.  But this isn't helping me see the how to move forward.  I know that the $\mu$ function is defined as $\mu(n)=(-1)^{\omega(n)}$ if $n$ is square free and $0$ if divisible by a square, so I think this plays a role somehow, but again, I'm feeling lost.
EDIT:  Would looking at $n=\prod_{i=1}^k{p_i^{\alpha_i}}$ be a more useful approach to the problem?  Knowing the larger summed function is multiplicative means I can focus my approach on the $p_i^{\alpha_i}$...

REPLY [6 votes]: Another, Combinatorial, way would be like $$\sum _{d|n} \mu (d) d(d)=\sum _{i=0}^{w(n)}\sum _{p_1<p_2 \ldots < p_i}\mu (p_1 \dots p_i)d (p_1 \dots p_i)=\sum _{i=0}^{w(n)}\binom{w(n)}{i}(-1)^i2^i=(1-2)^{w(n)}$$ where the $p_j$ are primes in the descomposition of $n$.