$\sigma(n) \equiv 1 \space \pmod{n}$ if and only if $n$ is prime

For $n>1$, let $\sigma(n)$ denote the sum of all positive integers that evenly divide $n$. Then $\sigma(n) ≡ 1 \space(mod\space n)$ if and only if $n$ is prime.

I've been trying to prove this for a long time, but i can't figure it out.


I found a theorem that might be helpful:

$\sigma(n) = n + k$ has finitely many solutions for $k > 1$ (more specifically, this equation has no solutions for $n≥k^2$).

proof:

let $n≥k^2>1,\space \sigma(n) = n + k$. Note that $n$ must be a composite number (otherwise $k=1$). Therefore, $n$ has a divisor $d≥\sqrt n$. From $\sigma(n)$'s definition:

$\sigma(n) ≥ n+d+1≥n+\sqrt n + 1 ≥ n + k + 1 > n + k$

If anyone can generalize this to $\sigma(n)=qn+k$, or something like that, it might help.


This is a hard problem.

If you can prove your conjecture, then it will imply immediately that there are no quasi-perfect numbers. The existence of quasi-perfect numbers is a long-open problem.