I would like to know why the following is true:
$$\tau(n^2) = \sum_{d | n} \mu(n/d)(\tau(d))^2$$
I cannot derive it. It is on OEIS but I'd like to know how this was found.
$\tau(n)$ is the count of divisors function and $\mu(n)$ is the Moebius function.
Outline: Both sides are multiplicative. So it is enough to check whether the result is correct for $n$ of the shape $p^m$, where $p$ is prime. That is a straightforward computation. Note that $\tau(p^t)=t+1$.
Added: Let $n=p^m$. Then $\tau(n)=2m+1$.
Now we look at the right-hand side. The only $d$ for which $\mu(n/d)\ne 0$ are $d=p^m$ and $d=p^{m-1}$.
For $d=p^m$, we have $\mu(n/d)=\mu(1)=1$ and $\tau(d)=m+1$. So $\mu(n/d)(\tau(d))^2=(m+1)^2$.
For $d=p^{m-1}$, we have $\mu(n/d)=-1$ and $\tau(d)=m$. So $\mu(n/d)(\tau(d))^2=-m^2$.
Finally, $(m+1)^2-m^2=2m+1$.