## Task A-3.3.

For a given prime number $p$, find all integers $n$ such that $\sqrt{n^{2}+p n}$ is an integer.
## First solution.

We consider two cases:

1. case $p \mid n \quad$ Then $n=p k, k \in \mathbb{Z}$ and we have

$$
\sqrt{n^{2}+p n}=\sqrt{p^{2} k^{2}+p^{2} k}=p \sqrt{k^{2}+k}
$$

However, $k^{2}+k=k(k+1)$ is a perfect square only if $k^{2}+k=0$, i.e., for $k=0$ and $k=-1$. The corresponding solutions are $n=0$ and $n=-p$.

2. case $p \nmid n \quad$ Then $M(n, n+p)=1$. For the expression under the square root $n^{2}+p n=n(n+p)$ to be a perfect square, it must be $n=a^{2}, n+p=b^{2}$, or $n=-b^{2}, n+p=-a^{2}$, for some $a, b \in \mathbb{N}_{0}$.

In both cases, $p=b^{2}-a^{2}=(b-a)(b+a)$, so we get (since $a+b>0$)

$$
\left\{\begin{array} { l } 
{ b - a = 1 } \\
{ b + a = p }
\end{array} \quad \text { or } \quad \left\{\begin{array}{l}
b-a=p \\
b+a=1
\end{array}\right.\right.
$$

The solution to the first system is $a=\frac{p-1}{2}, b=\frac{p+1}{2}$, and the second system's solution is $a=\frac{1-p}{2}, b=\frac{p+1}{2}$.

If $n=a^{2}$, we get $n=\left(\frac{p-1}{2}\right)^{2}$, and if $n=-b^{2}$, then $n=-\left(\frac{p+1}{2}\right)^{2}$.

These are integers, so they are solutions to the problem only for $p>2$.