Find all pairs of positive integers $(a, b)$ such that $a-b$ is a prime and $ab$ is a perfect square. Answer: Pairs $(a, b)=\left(\left(\frac{p+1}{2}\right)^{2},\left(\frac{p-1}{2}\right)^{2}\right)$, where $p$ is a prime greater than 2.
Let $p$ be a prime such that $a-b=p$ and let $a b=k^{2}$. Insert $a=b+p$ in the equation $a b=k^{2}$. Then

$$
k^{2}=(b+p) b=\left(b+\frac{p}{2}\right)^{2}-\frac{p^{2}}{4}
$$

which is equivalent to

$$
p^{2}=(2 b+p)^{2}-4 k^{2}=(2 b+p+2 k)(2 b+p-2 k) .
$$

Since $2 b+p+2 k>2 b+p-2 k$ and $p$ is a prime, we conclude $2 b+p+2 k=p^{2}$ and $2 b+p-2 k=1$. By adding these equations we get $2 b+p=\frac{p^{2}+1}{2}$ and then $b=\left(\frac{p-1}{2}\right)^{2}$, so $a=b+p=\left(\frac{p+1}{2}\right)^{2}$. By checking we conclude that all the solutions are $(a, b)=\left(\left(\frac{p+1}{2}\right)^{2},\left(\frac{p-1}{2}\right)^{2}\right)$ with $p$ a prime greater than 2.