Let $p$ be a prime. Find all nonzero integers $k$ such that $\sqrt{k^2 − pk}$ is a positive integer.
I first let $k^2 - pk = x^2,$ where $x$ is a positive integer. However, I got stuck from here as I wasn't quite sure what to do with the condition that $p$ is a prime. Can someone help me please?
hint
Consider the condition $$k^2-pk-x^2=0$$
as a quadratic in $ k $ with discriminant
$$\Delta= p^2+4x^2$$
which must be a perfect square
$$p^2=y^2-4x^2=(y+2x)(y-2x)$$