Divisor Count Function is Odd Iff Argument is Square

Theorem
Let $$\tau: \Z \to \Z$$ be the tau function.

Then $$\tau \left({n}\right)$$ is odd iff $$n$$ is square.

Proof
Let $$n$$ be an integer such that $$n \ge 2$$, with prime decomposition $$n = p_1^{k_1} p_2^{k_2} \ldots p_r^{k_r}$$.

Then from Tau Function - Number of Positive Divisors we have that $$\tau \left({n}\right) = \prod_{i=1}^r \left({k_i + 1}\right)$$.


 * Let $$\tau \left({n}\right)$$ be odd.

Then all factors of $$\prod_{i=1}^r \left({k_i + 1}\right)$$ are odd (and of course $$\ge 3$$).

Therefore all factors of $$\prod_{i=1}^r \left({k_i}\right)$$ are even.

Thus $$n = p_1^{2 s_1} p_2^{2 s_2} \ldots p_r^{2 s_r}$$ for $$r_i = k_i / 2$$ for all $$i$$.

Hence $$n = \left({p_1^{s_1} p_2^{s_2} \ldots p_r^{s_r}}\right)^2$$ and therefore is square.


 * Now suppose $$n$$ is square.

The above argument reverses, and we see that all factors of $$\prod_{i=1}^r \left({k_i + 1}\right)$$ are odd.

Hence $$\tau \left({n}\right)$$ is itself odd.