On the natural density of almost perfect numbers This question is pretty basic, so I apologize in advance if it is unsuitable for MO.  If so, please do let me know and I will migrate it over to MSE.
Essentially, by work of Kanold, we know that the natural density of the perfect numbers $N$ for which
$$\sigma(N) = 2N$$
is $0$.  Now my question is:  Is it known that a similar result holds for almost perfect numbers $M$, whereby
$$\sigma(M) = 2M - 1$$
holds?
I tried searching for an answer via Google, but it did not return any relevant results.
If this problem is currently open, I would appreciate it very much if you could point me to recent literature on research work done in this area.
Thanks!
 A: In fact, $\sigma(N)$ is odd only if $N$ is a square or twice a square, which already occurs only a set of density $0$. So the `right' problem is to do significantly better than $x^{1/2}$ for the count of almost perfect $N \le x$. One could modify the approach in Captain Darling's answer to get a bound of $o(X^{1/2})$, by looking at the distribution function of $\sigma(N^2)/N^2$.
This can be further improved using different ideas. The count of almost perfect $N \le x$ is known to be at most $x^{\frac14+\epsilon}$, for  any $\epsilon > 0$ and all $x > x_0(\epsilon)$. See Theorem 1.1 in "On the distribution of some integers related to perfect and amicable numbers" in Colloq. Math, by Pollack and Pomerance. Here's a link to a PDF: https://math.dartmouth.edu/~carlp/pollack-pomerance-preprint.pdf
A: The natural density is $0$. This is due to the function $\sigma(n)/n$ possessing a continuous distribution, i.e. there exists a continuous function $\Phi:\mathbb{R}\to \mathbb{R}$ such that for all $a<b$ real numbers one has $$\lim_{x\to \infty}\frac{1}{x}\#\Big\{1\leq n \leq x: a<\frac{\sigma(n)}{n} \leq b\Big\}=\Phi(b)-\Phi(a).$$ Fix any $k \in \mathbb{Z}$. Considering any $\epsilon>0$ we see that for $n>\frac{|k|}{\epsilon}$ the natural density of integers $n$ such that $\sigma(n)=2n+k$ is at most the density of integers $n$ with $$-\epsilon+2<\frac{\sigma(n)}{n}\leq 2$$ which equals $\Phi(2)-\Phi(2-\epsilon).$ Now since $\Phi$ is continuous we see that taking arbitrarily small $\epsilon$ the density of your integers $M$ is smaller than any positive number so it must vanish.
Obviously for a specific choice of $k$ one can do better but the approach here does in fact provide density $0$ in very general situations.
EDIT:(references) According to this paper of Erdős the first published proof was given by Davenport in a 1934 paper not listed in Mathscinet but the method was identically the same as Schoenberg's earlier result that $\phi(n)/n$ has a continuous distribution.
