[Math] When the sum of all divisors of a natural number is odd

number theory

Prove that the sum of all divisors of a natural number $n$ is odd if and only if $n = 2^r \cdot k^2$ where $k$ and $r$ are natural numbers.

The first direction: if $k^2$ is an even number, we rewrite $2^r \cdot k^2$ as $2^{(r+m)} \cdot z$ where $z$ is a natural odd number. Now, the sum of all divisors of $2^{(r+m)}$ without $1$ is even, and the sum of of all divisors of $z$ is odd, so we get odd.
This is true?
To the other direction, I have no idea…

Best Answer

Hint: all divisors of an odd number are odd, so you need to have an odd number of them. Can you see why $k^2$ has an odd number of factors? The sum of divisors function is multiplicative, so you have taken care of $2^{(r+m)}$, you can consider $k$ to be odd.