3. let $p$ be an odd prime number. Find all natural numbers $k$ such that

$$
\sqrt{k^{2}-p k}
$$

is a positive integer.

## Solution
Let $\sqrt{k^{2}-p k}=m$ with $m>0$ integer. Then $k(k-p)=m^{2}$ applies. We now distinguish between two cases.

$p \mid k$ Then $m$ is also divisible by $p$. Write $k=p \cdot l$ and $m=p \cdot n$, then $l(l-1)=n^{2}$ follows. Because of $l \geq 2$ and

$$
(l-1)^{2}<l^{2}-l<l^{2}
$$

but $l(l-1)$ lies between two consecutive square numbers, so it cannot be a square number itself, contradiction.

$p \nmid k$ In this case, $k$ and $k-p$ are not related. Since their product is a square, both numbers must be squares: $k=b^{2}, k-p=a^{2}$. Now the following applies

$$
p=b^{2}-a^{2}=(b-a)(b+a)
$$

Since $p$ is prime, $1=b-a$ and $p=a+b$ follows. This results in the only possible value $k=((p+1) / 2)^{2}$. In fact, for this $k$

$$
\sqrt{k^{2}-p k}=\frac{p^{2}-1}{4}
$$

is a positive integer, because $p^{2} \equiv 1(\bmod 4)$.