How do I find integer solutions to this nonlinear equation with two unknowns and several other constraints?

29 Views Asked by At

Constraints:

$$ xy+x+y=n $$ $$ 0 \le x < m $$ $$ 0 \le y < m $$ $$ x \ne y $$

Given integers $n$ and $m$, with $n>0$ and $m>1$, how do I find the integer solutions for $x$ and $y$? I have found specific solutions via WolframAlpha but am unable to find a general solution in terms of $m$ and $n$.

1

There are 1 best solutions below

3
On

$xy + x + y = n$

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

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

$(x+1)(y+1) = n+1$.

Factor $n+1$ and find all possible values of $x$ and $y$.
If possible.