1. For a given positive integer $k$, we call an integer $n$ a $k$-number if both of the following conditions are satisfied:
(i) The integer $n$ is the product of two positive integers which differ by $k$.
(ii) The integer $n$ is $k$ less than a square number.
Find all $k$ such that there are infinitely many $k$-numbers.
Solution
Note that $n$ is a $k$-number if and only if the equation
$$
n=m^{2}-k=r(r+k)
$$
has solutions in integers $m, r$ with $k \geq 0$. The right-hand equality can be rewritten as
$$
k^{2}-4 k=(2 r+k)^{2}-(2 m)^{2},
$$
so $k$-numbers correspond to ways of writing $k^{2}-4 k$ as a difference of two squares, $N^{2}-M^{2}$ with $N>r$ and $M$ even (which forces $N$ to have the same parity as $k$ ). Any non-zero integer can only be written as a difference of two squares in finitely many ways (e.g. since the gaps between adjacent squares grow arbitrarily large), so if $k \neq 4$ then there are only finitely many $k$-numbers.

Conversely, if $k=4$ then setting $m=k+2$ for $k \geq 0$ shows that there are infinitely many 4-numbers.