Let $\sigma (n)$ be the sum of all positive divisors of $n\in\mathbb{N}$. Determine for which least $n$:
$$\sigma (x) = n$$
has exactly two and exactly three solutions.
The problem also asks for the least $n$ for which there are no solutions and exactly one solution, but that was easy. If there are no solutions, then a prime will do - 2 is the least. If there is exactly one solution, the least is $1$ itself.
Now, how about the problem at hand? Also, can one generalize and find the least $n$ such that $\sigma (x) = n$ has exactly $m$ solutions?
I figured $n>1$ if there are exactly two solutions, so
$$n=p_1^{k_1}\cdot\ldots\cdot p_r^{k_r} = \prod_{j=1}^s \frac{q_j^{l_j+1}-1}{q_j -1} =\sigma (x)$$
assuming $x>1$ indeed holds, which it should. But this leads absolutely nowhere, I don't have any bright ideas for this problem. How to proceed?
Your statement that "if there are no solutions, then a prime will do", is a little incorrect both ways, because if $n$ is prime there can be solutions of $\sigma(x)=n$, for example for $n=3, 7, 13, 31, 127, 307,\dots$.
On the other side, also for several composite $n$ there are no solutions, namely for $n=9, 10, 16, 21, 22, 25, 26,\dots$.
For the problem of finding the smallest $n$ for which there are $2$ and $3$ solutions, I fear there is not a simpler solution than listing the values of $\sigma(x)$ for $x$ up to a small limit, exploiting the fact that since $\sigma(k) \ge k$ we do not risk to miss some repeated value.
Indeed, it is sufficient to compute $\sigma(x)$ for $x<24$ to find that the smallest $n$ for which there are $2$ and $3$ solutions are, respectively, $12$ and $24$, where $12=\sigma(6)=\sigma(11)$ and $24=\sigma(14)=\sigma(15)=\sigma(23)$.