Finding all nonzero integers $k$ so that $\sqrt{k^2 - pk}$ is a positive integer

314 Views Asked by At

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?

2

There are 2 best solutions below

0
On

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)$$

0
On

Proceed with your notation. We have $k^2-x^2 = pk \iff (k-x)(k+x) = pk$. Now since $p$ is a prime, it must be the case that at least one of the $k-x$ and $k+x$ is a multiple of $p$.

(1) If $x$ and $k$ are both multiple of $p$: let $k$ = $mp$ and $x=np$, thus the equation simplifies to $m(m-1)=n^2$. Since $\operatorname{gcd}(m,m-1) = 1$, it must be the case that $m$ and $m-1$ are squares. The only possibility is $m=1$.

(2) Otherwise, $k$ and $x$ can't be multiple of $p$ (why?). Also observe that $(k-x)<p$. Can you continue from here?