TITLE: Prove that if $\sigma(n)=2n+1$ then $n$ is an odd perfect square.
QUESTION [13 upvotes]: Prove that if $\sigma(n)=2n+1$ then $n$ is an odd perfect square.
(Here, $\sigma(n)$ is the sum of the positive divisors of $n$
including 1 and $n$ itself.)
As I know, this $n$ is a quasiperfect number, and I just proved that $n$ is a perfect square or $\frac{n}{2}$ is a perfect square.

REPLY [10 votes]: I had seen this result before, but not the proof, so I looked up Cattaneo's original argument.  It's in Italian.  What follows is his proof with some details filled in.  
First, if $\sigma(n) = 2n+1$ then $\sigma(n)$ is odd.
If $n = \prod_{i=1}^r p_i^{a_i}$ is the prime factorization of $n$, then we know that 
$$\sigma(n) = \prod_{i=1}^r (1 + p_i + p_i^2 + \cdots + p_i^{a_i}).$$
Since $\sigma(n)$ is odd, though, each factor $1 + p_i + p_i^2 + \cdots + p_i^{a_i}$ must also be odd.   
For each odd prime factor $p_i$, then, there must be an odd number of terms in the sum $1 + p_i + p_i^2 + \cdots + p_i^{a_i}$.  Thus $a_i$ must be even.  This means that if $p_i$ is odd, $p_i^{a_i}$ is an odd perfect square.  The product of odd perfect squares is another odd perfect square, and therefore $n = 2^s m^2$, where $m$ is odd.
Now we have $\sigma(n) = (2^{s+1}-1)M$, where $M = \prod_{p_i \text{ odd}} (1 + p_i + p_i^2 + \cdots + p_i^{a_i})$.  Since $\sigma(n) = 2n+1$, 
\begin{align*}
&(2^{s+1}-1)M = 2^{s+1}m^2 + 1 \\
\implies &(2^{s+1}-1)(M - m^2)-1 = m^2. 
\end{align*}
This means that $-1$ is a quadratic residue for each prime factor of $2^{s+1}-1$.  A consequence of the quadratic reciprocity theorem, though, is that $-1$ is a quadratic residue of an odd prime $p$ if and only if $p \equiv 1 \bmod 4$.  Thus all prime factors of $2^{s+1}-1$ are congruent to $1 \bmod 4$.  The product of numbers congruent to $1 \bmod 4$ is still congruent to $1 \bmod 4$, so $2^{s+1}-1 \equiv 1 \bmod 4$.  However, if $s > 0$, then $2^{s+1}-1 \equiv 3 \bmod 4$.  Thus $s$ must be $0$.  Therefore, $n = m^2$, where $m$ is odd.