Problem 9.3. Find all four-digit positive integers $m$ less than 2005 for which there exists a positive integer $n<m$, such that $m n$ is a perfect square and $m-n$ has at most three distinct positive divisors.

Peter Boyvalenkov, Ivailo Kortezov
9.3. The number $m-n$ has at most three different positive divisors if and only if $m-n=p^{k}$, where $p$ is a prime and $k \in\{0,1,2\}$. If $k=0$ then $m=n+1$
and $n(n+1)$ is a perfect square, which is impossible. Let $m-n=p^{k}, m n=t^{2}$, where $k \in\{1,2\}$ and $t$ is a positive integer. Then

$$
n\left(n+p^{k}\right)=t^{2} \Longleftrightarrow\left(2 n+p^{k}-2 t\right)\left(2 n+p^{k}+2 t\right)=p^{2 k}
$$

Therefore $2 n+p^{k}-2 t=p^{s}$ and $2 n+p^{k}+2 t=p^{r}$, where $r$ and $s$ are integers, such that $0 \leq s<r \leq 2 k$ and $r+s=2 k$.

For $k=1$ we have the unique possibility $2 n+p-2 t=1,2 n+p+2 t=p^{2}$. Hence

$$
n=\frac{(p-1)^{2}}{4}, \quad m=n+p=\frac{(p+1)^{2}}{4}
$$

Taking into account that $1000 \leq m<2005$ we obtain the solutions $m=1764$, $1600,1369,1296$ and 1156 (for $p=83,79,73,71$ and 67 , respectively).

For $k=2$ we have $(r, s)=(4,0)$ or $(r, s)=(3,1)$. In the first case we get

$$
n=\frac{\left(p^{2}-1\right)^{2}}{4}, \quad m=n+p^{2}=\frac{\left(p^{2}+1\right)^{2}}{4}
$$

Now the inequalities $1000 \leq m<2005$ imply that $p=8$ which is not a prime. In the second case we have $m=p(p+1)^{2} / 4$, which gives the solutions $m=1900$ and 1377 (for $p=19$ and 17 , respectively).