In what follows, assume that $d > 0$.
Let $$\sigma(x)=\sum_{e \mid x}{e}$$ denote the classical sum-of-divisors function, and denote the deficiency of $x \in \mathbb{N}$ by $$D(x)=2x-\sigma(x).$$
Here is my question:
If $$\sigma(n) = 2n - d$$ and $$d \mid n,$$ is it true that $$d = \gcd(n,\sigma(n))?$$
In other words, if $D(n) \mid n$, does it necessarily follow that $$D(n) = \gcd(n,\sigma(n))?$$
MY ATTEMPT
Suppose that $D(n) = d \mid n$. This implies that $n/d = a$ for some $a \in \mathbb{N}$. Likewise, since $d \mid n$, then $d \mid (2n - d) = \sigma(n)$, so that $\sigma(n)/d = b$ for some $b \in \mathbb{N}$.
$$\gcd(n,\sigma(n))=d\gcd\bigg(\frac{n}{d},\frac{\sigma(n)}{d}\bigg).$$
I would be done with my proof if I could show that
$$\gcd\bigg(\frac{n}{d},\frac{\sigma(n)}{d}\bigg)=1.$$
Alas, this is where I get stuck.
Clearly $d$ is a common divisor. If $k$ is any common divisor then $k\mid 2n-\sigma(n)=d$. So $d$ is the gcd.