## Task A-4.1.

For a natural number $n$, let $s(n)$ denote the sum of its positive divisors, and $d(n)$ the number of its positive divisors. Determine all natural numbers $n$ such that

$$
s(n)=n+d(n)+1
$$
## Solution.

Notice that $n=1$ is certainly not a solution, so $d(n) \geqslant 2$.

Furthermore, it is not possible for $d(n)=2$ because then the number $n$ would be prime and the given equation would read $1+n=n+2+1$, so $d(n) \geqslant 3$.

Let $1=D_{1}<D_{2}<\cdots<D_{d}=n$ be the divisors of the number $n$. The initial equation reads

$$
1+\sum_{i=2}^{d(n)-1} D_{i}+n=n+d(n)+1
$$

Since $D_{i} \geqslant 2$ for all $i \in\{2,3, \ldots, d(n)-1\}$, we have $d(n)=\sum_{i=2}^{d(n)-1} D_{i} \geqslant(d(n)-2) \cdot 2$, from which it follows that $d(n) \leqslant 4$, or $3 \leqslant d(n) \leqslant 4$.

For $d(n)=3$, the number $n$ is the square of some prime number $p$ and the initial equation reads

$$
1+p+p^{2}=p^{2}+3+1
$$

from which it follows that $p=3$ and $n=p^{2}=9$.

For $d(n)=4$ we have two possibilities.

a) If $n$ is the product of some prime numbers $q$ and $r(q<r)$, then the initial equation reads $1+q+r+q r=q r+4+1$, from which it follows that $q+r=4$. There are no such prime numbers $q$ and $r$.

b) If $n$ is the cube of some prime number $s$, then the initial equation reads $1+s+s^{2}+s^{3}=s^{3}+4+1$, from which it follows that $s^{2}+s-4=0$. There is no such natural number $s$.

Therefore, the only solution is $n=9$.