TITLE: A conjecture concerning the number of divisors and the sum of divisors.
QUESTION [9 upvotes]: 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?

REPLY [8 votes]: In a more descriptive style of argument:
The parity of $\tau(n)$, the number of divisors of $n$, depends on whether the divisors are composed entirely of distinct factor pairs $(d_1,d_2)$ or whether there is a square root $n=d_s\cdot d_s$ to make the count odd.
$\tau(n)$ is odd $\iff n$ is a perfect square.
The parity of $\sigma(n)$, the sum of divisors of $n$, depends on the count of its odd factors. We can thus ignore all even factors of $n$, so focus on the odd number $\ell$ defined by $n=2^k\ell$. Then as before if $\ell$ has only distinct factor pairs $(d_1,d_2)$ the sum will be even, and only if $\ell$ has a square root $d_s$ will the sum be odd.
$\sigma(n)$ is odd $\iff \ell$, the largest odd factor of $n$, is a perfect square.
So for $\tau(n)+\sigma(n)$ to be odd, we cannot have $n$ a perfect square - that would make both $\tau(n)$ and $\sigma(n)$ odd, so the sum even. So we need $\ell$ square (for $\sigma(n)$ odd) and $2^k$ not square (for $\tau(n)$ even), which makes $2^{k-1}$ square. Thus we can set $m=\sqrt{2^{k-1}\ell\ \ }$ giving $n=2m^2$.
By the same calculations we can see that $n=2m^2$ will give $\tau(n)+\sigma(n)$ odd.