The number of divisors of a number whose sum of divisors is a perfect square

Solution 1:

The only numbers with exact $2$ proper divisors are the numbers of the form $p^2$, where p is a prime.

The proper divisors are $1$ and $p$ in this case, and $p+1$ with $p$ prime can only be a perfect square for $p=3$.

This follows from the equation $p=a^2-1=(a-1)(a+1)$. If $a>2$ , then $p$ cannot be a prime.

So, there is only $1$ case of $2$ divisors.

For the case of $4$ divisors, we have to find all primes $p$, such that $p^3+p^2+p+1=(p+1)(p^2+1)$ is a perfect square.

Suppose, $q$ is a divisor of $p+1$ and $p^2+1$, so we have $p\equiv -1\ (\ mod\ q\ )$ and $p^2\equiv -1\ (\ mod\ q\ )$.

Since we also have $p^2\equiv 1\ (\ mod\ q\ )$, we can conclude $q=2$.

The case $gcd(p+1,p^2+1)=1$ would imply, that $p+1$ is a square, which is only possible for $p=3$, as already mentioned, but $3^2+1=10$ is not a square.

So, we can conclude that

$$p+1=2a^2\ \ \ \ \ \ \ p^2+1=2b^2$$

with $gcd(a,b)=1$

It seems that only $p=7$ solves these equations. If there is another solution, it must contain more than $100\ 000$ digits which I checked examining the solutions of the equation $x^2-2y^2=-1$

The number of proper divisors is even only for squares. I checked them and found two more examples for an even number :

$$35713^2=1275418369$$

has $8$ proper divisors.

$$102851^2=10578328201$$

has $14$ proper divisors.

Furthermore, I found an example with $3$ distinct prime factors :

$195534000$ has $399=3\times 7 \times 19$ proper divisors.