I stumbled upon the following conjecture:
Let $n$ be a positive integer. Let $\sigma\left(n\right)$ be the sum of all (positive) divisors of $n$, and let $\tau\left(n\right)$ be the number of these divisors. Then, $$\tau(n)+\sigma(n)\equiv 1 \mod 2 \iff n = 2m^2 \text{ for some integer } m .$$
Does anybody have an idea on how to prove this, maybe in parts? Or maybe someone has a counterexample?
In fact, this conjecture holds as we will show.
Proof: Let $n = \prod_{i=1}^n p_i^{e_i}$, then $$\tau(n) = \prod_{i=1}^n (e_i +1)$$ and $$\sigma(n) = \prod_{i=1}^n \Big( \sum_{j=0}^{e_i} p_i^j \Big).$$ For $p_i >2$, we see that $(e_i +1)$ is even if and only if $ \sum_{j=0}^{e_i} p_i^j$ is even (sum of $n$ odd numbers is even if and only if $n$ is even). In other words $$(e_i+1) \equiv \sum_{j=0}^{e_i} p_i^j \quad \mathrm{mod} \ 2.$$ Thus, if only one $e_i$ of the $p_i >2$ is odd, we get already that $$\tau(n) + \sigma(n) \equiv 0 \quad \mathrm{mod} \, 2.$$ Assuming that $$\tag{1} \tau(n) + \sigma(n) \equiv 1 \quad \mathrm{mod} \ 2$$ we see that all $e_i$ are even if $p_i >2$. If $p_1=2$, then (1) reduces to $$(e_1+1) + 2^{e_1+1} -1 \equiv 1 \quad \mathrm{mod} \ 2.$$ Thus $e_1 \equiv 1 \mod 2$. Writing $e_1 = 2 k_1 +1 $ and $e_i = 2k_i$, we get $$n = 2 m^2,$$ where $$m = \prod_{i=1}^n p_i^{k_i}.$$ This calulcations shows also that for $n = 2m^2$ we have $\tau(n)+\sigma(n) \equiv 1 \ \mathrm{mod} \ 2$.