<s>[INST] If $\frac{x^2+y^2+x+y-1}{xy-1}$ is an integer for positive integers $x$ and $y$, then its value is $7$. I saw this on quora
and haven't been able to solve it.
If $\dfrac{x^2+y^2+x+y-1}{xy-1}$
is an integer for positive integers
$x$ and $y$,
then its value is $7$.
If
$y=1$ this is
$\dfrac{x^2+x+1}{x-1}
= x+2+\dfrac{3}{x-1}$
which is an integer only when
$x=2$ or $x=4$ and has value $7$.
Looking at the values from 2 to 20
for $x$ and $y$,
this is an integer only for
$x=2, y=12$ (and $x=12, y=2$).
This value is 7.
So it looks like this might be correct,
and I don't know how to show it.
 [/INST] there are just two flavors of these; For integer $k$  we are looking for integer points on the arc of
$$ x^2 - kxy + y^2 + x + y = 1 -k $$
between the lines $ky = 1 + 2x$  and $kx = 1+2y$
For $k > 7$  the arc includes a point $(t,t)$ with $1 < t < 2$
Calculation will show that, for $x=2,$  we have $y < 1,$   and the (local) minimum $y$  occurs exactly where the line $ky = 1+2x$ intersects the hyperbola.
Here is $k=10$


for $k < 7$  the local min is above $1$  but the slanted lines are closer together...


I mention a second flavor, those are when $ x^2 + kxy + y^2$ is some small number and the picture is rotated.
</s>