How do I manually solve $x+y=xyz-1$ assuming that $x, y$ and $z$ are positive integers? I was able to guess all possible solutions, but I do not know how to show that these are the only ones:
$x=1, y=1, z=3$
$x=1, y=2, z=2$
$x=2, y=1, z=2$
$x=2, y=3, z=1$
$x=3, y=2, z=1$

Any hints would be appreciated.

  • 2
    $\begingroup$ $x+y=z*xy-1$ is not linear. $\endgroup$ – uniquesolution Oct 17 '15 at 12:07

We have $$z=\frac{x+y+1}{xy}=\frac 1y+\frac 1x+\frac{1}{xy}\le 1+1+1$$$$\Rightarrow z=1,2,3$$

Also, $$zxy-x-y=1\iff z^2xy-zx-zy+1=z+1\iff (zx-1)(zy-1)=z+1$$

So, for $z=1$, we have $(x-1)(y-1)=2$.

For $z=2$, we have $(2x-1)(2y-1)=3$.

For $z=3$, we have $(3x-1)(3y-1)=4$.


WLOG let $x\le y$, and we need $$\frac1x+\frac1y+\frac1{xy}=z$$

Clearly if $x\ge3$, LHS $<1$, so we need to check only for $x=1,2$. Similarly it is not hard to bound possible $y$ hence you only get a few values to test out.


Note that for $x,y$ positive integers $$xy\ge x+y+1$$ for $x>2$ and $y\ge 3$ (or vice verse). Therefore you can control only $y=1$(or vice verse) and $y=x=2$

If $x=1$ the equation becomes: $$y(z-1)=1$$ and the solutions are $z=2$ $y=2$ and $z=3$, $y=1$. The same thing for $y=1$. While for $y=x=2$ there aren't solutions.


Alternative solution:

$x\mid y+1$ and $y\mid x+1$, so $x-1\le y\le x+1$. Simply check cases:

  • If $x-1=y$, then $y\mid x+1$ gives $x-1\mid x+1$, i.e. $x-1\mid 2$, i.e. $x\in\{3,2\}$, so $y\mid x+1\in\{4,3\}$, so $y\in\{1,2,3,4\}$.

  • If $x=y$, then $x\mid 1, y\mid 1$.

  • If $x+1=y$, then $x\mid y+1=x+2$, so $x\mid 2$, so $(x,y)\in\{(1,2),(2,3)\}$.

It's left to check $11$ cases (knowing $(x,y)$ find $z$).


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.