Find the integers $n \geq 1$ and $p$ primes such that $n p+n^{2}$ is a perfect square.
There are two cases:

- If $p \mid n$, then we can write $n=k p$ with $k \in \mathbb{N}^{*}$. We then have that $k p(k p+p)=k(k+1) p^{2}$ is a perfect square, so $k(k+1)$ is a perfect square. Since $k$ and $k+1$ are coprime, each one is a perfect square. Writing $k=a^{2}$ and $k+1=b^{2}$ with $a, b>0$, we get $1=a^{2}-b^{2}=(a+b)(a-b)$. Since $k \geq 1, a \geq 1$ and $b \geq 1$, 1 has an integer divisor, which is impossible.
- Otherwise, $n$ and $n+p$ are coprime, so both are squares. We write $n=a^{2}$ and $n+p=b^{2}$ with $a, b>0$. Then $(b-a)(b+a)=b^{2}-a^{2}=p$. Since $p$ is prime and $b+a \geq 2$ divides $p$, we have $a+b=p$ and $b-a=1$, so $b=\frac{p+1}{2}$ and $a=\frac{p-1}{2}$, hence $n=\left(\frac{p-1}{2}\right)^{2}$ and $p$ is odd.

Conversely, the pairs $\left(\left(\frac{p-1}{2}\right)^{2}, p\right)$ with $p$ an odd prime work because:

$$
\left(\frac{p-1}{2}\right)^{2}\left(\left(\frac{p-1}{2}\right)^{2}+p\right)=\left(\frac{p^{2}-1}{2}\right)^{2}
$$