<s>[INST] Quadratic Diophantine Equation$(x^2+x)(y^2-1)=240$ For whole numbers $x$ and $y$,  $$x,y | (x^2+x)(y^2-1)= 240$$
Find the biggest and smallest value for $x-y$.
How do you proceed with such a question?
Are their formulas or something for that type of equation?
I'd appreciate any help.
 [/INST] Here is a table of whole numbers $x$ so that $x^2+x\mid240$:
$$
\begin{array}{c|c}
x&1&2&3&4&5&15\\\hline
x^2+x&\color{#090}{2}&6&12&20&\color{#090}{30}&240
\end{array}
$$
For $x$ to work, we need $\frac{240}{x^2+x}+1=y^2$:
$\frac{240}{2}+1=11^2$
$\frac{240}{6}+1=41$
$\frac{240}{12}+1=21$
$\frac{240}{20}+1=13$
$\frac{240}{30}+1=3^2$
$\frac{240}{240}+1=2$
The choices we have are $\{x=1,y=11\}$ and $\{x=5,y=3\}$. Thus, the smallest is $x-y=-10$ and the largest is $x-y=2$.
</s>