Exercise 8. Find all natural numbers $\mathrm{k}>0$ such that the equation in $x$ and $\mathrm{y}$:

$$
x(x+k)=y(y+1)
$$

has a solution in strictly positive integers.
## Solution.

The equation from the statement can also be written as $\left(x+\frac{k}{2}\right)^{2}=\left(y+\frac{1}{2}\right)^{2}+\frac{k^{2}-1}{4}$, or, by factoring:

$$
\left(x-y+\frac{k-1}{2}\right) \cdot\left(x+y+\frac{k+1}{2}\right)=\frac{k^{2}-1}{4}
$$

We distinguish two cases based on the parity of $k$. If $k$ is odd, we write $k=2 a+1$ and the previous equation becomes $(x-y+a)(x+y+a+1)=a(a+1)$. By setting the first factor to 1 and the second to $a(a+1)$, we get $x=\frac{a(a-1)}{2}$ and $y=x+(a-1)=\frac{(a-1)(a+2)}{2}$. Given that the product of two consecutive integers is always even, the values we have obtained form a solution as soon as $a>1$. For $a=1$ (i.e., $k=3$), on the contrary, there is no solution, because the equality $(x-y+1)(x+y+2)=2$ cannot be satisfied given that the second factor is always $>2$ when $x$ and $y$ are strictly positive. For $a=0$, finally, we have $k=1$ and, clearly, all pairs $(x, y)$ are suitable.

We reason similarly in the case where $k$ is even. We set $k=2 a$ and equation (2) becomes $(2 x-2 y+2 a-1)(2 x+2 y+2 a+1)=4 a^{2}-1$. As before, by setting the first factor to 1, we obtain a system in $x$ and $y$ whose solutions are $x=a(a-1)$ and $y=(a+1)(a-1)$. This solution is acceptable as soon as $a>1$. For $a=1$, the equation to solve becomes $(2 x-2 y+1)(2 x+2 y+3)=3$ and it has no solution with $x, y>0$ given that this condition implies that the second factor is $>3$.

In summary, the integers $k$ that work are $k=1$ and all integers $k \geqslant 4$.

![](https://cdn.mathpix.com/cropped/2024_06_04_6c96fb1ce2d0d58c89f6g-09.jpg?height=95&width=203&top_left_y=1465&top_left_x=950)