How often does $D(n^2) = m^2$ happen, where $D(x)$ is the deficiency of $x$? Let $\sigma=\sigma_{1}$ denote the classical sum of divisors.  For instance, $\sigma(12) = 1 + 2 + 3 + 4 + 6 + 12 = 28$.
Let $x \in \mathbb{N}$ ($\mathbb{N}$ is the set of natural numbers/positive integers).  Denote the number $2x - \sigma(x)$ by $D(x)$.  We call $D(x)$ the deficiency of $x$.
Now, let $m, n \in \mathbb{N}$.  Here is my question:

How often does $D(n^2) = m^2$ happen, where $D(x)$ is the deficiency of $x$?

MY ATTEMPT
I note (from the OEIS sequence listing) that $D(n^2) = m^2$ holds when 
$$(m, n) = \left\{(1, 1), (1, 2), (1, 4), (1, 8), \ldots \right\}$$
So, $n=2^r$ for integers $r \geq 0$ is an infinite family of numbers satisfying $D(n^2) = m^2$ (in particular, $m = 1$).


Are $n=2^r$ for $r \geq 0$ the only numbers for which $D(n^2) = m^2$?


 A: Using computer power, it is easy to find counterexamples, e.g.
$D(46^2) = 19^2$ or $D(284^2)=53^2$.
A: It is easy to prove that for prime $p\neq 2$, $D(p^2) = p^2-p-1$ is not a square, since the highest square below $p^2$ is $p^2-2p+1 < p^2-p-1$.
I can also prove $D((2p)^2) = p^2-7p-7$ is not a square.  The proof runs along these lines:  If $p^2-7p-7=r^2$ and $p$ is an odd prime, then $r$ is also odd.  Let $p=2q+1, r=2s+1$ and 
$$
4q^2-10q-14 = 4s(s+1)
$$ 
 so $q\equiv -1 \pmod 4$.  Take $q= 4w-1$, then 
$$16w^2-12w-2 = s(s+1)$$
This implies $s$ is either $1$ or $2$ mod $4$. We can eliminate the possibility of $s=4t+1$ since that leads to $(w+t)(4w-4t+3) = 4$ which cannot be satisfied.
Taking $s=4t+2$ we obtain 
$$
4(w^2-t^2) -3w-5t = 8
$$
let $k=w+t$ and $\ell = w-t$, then
$$4k\ell - 4k + \ell = 8$$
so we can write $\ell = 4j$.
But 
$$
4kj-k+j = 8 \implies (4j-1)k +j = 8
$$
If $j=0$ then $k$ is negative, which does not lead to a solution, and if $j>\neq 0$ then one need check only very small combinations of $k,j$ before the factor in front of $k$ becomes greater than $8$ and allows us to show no combinations will work.
In fact, similar reasoning shows that if $D(n^2)=m^2$ and $n\neq 2^r$ then $n$ must have more than two prime factors.  But I can't progress past that.
