# Finding integers of the form $m+n$ that satisfies $m+n+mn=118$

Let $m$ and $n$ be two positive integers such that $m+n+mn=118.$

My question is: Can the value of $(m+n)$ be uniquely determined?

I find by inspection that the pair $(m,n)=(16,6)$ (or the pair $(6,16)$) satisfies the above equation, i.e. $m+n=22$ satisfies the above equation. I guess that the value of $(m+n)$ can't be uniquely determined, but I neither find any other values of $m+n$. Any hints/way to tackle this problem?

This type of diophantine equation is solvable by a generalization of completing the square. Namely, completing a square generalizes to completing a product as follows:

$$\begin{eqnarray} &&axy + bx + cy\, =\, d,\ \ a\ne 0\\ \overset{\times\,a}\iff\, &&\!\! (ax+c)(ay+b)\, =\, ad+bc\end{eqnarray}\qquad\qquad$$

Applied to the OP we deduce $\ xy + x + y = d \iff (x+1)(y+1) =\, d+1$

By uniqueness of prime factorizations we can enumerate the finite number of ways that $\,d+1\,$ splits into two factors $\,x+1,\ y+1\,$ then solve for $\,x,y\,$ in each case.

Hint: You can write your equation as $(m+1)(n+1)=119$, then factor $119$

You can solve it as follows: $$mn+m+n=118\iff mn+m+n+1=119\iff (m+1)(n+1)=119=7*17$$ Now, since $m,n$ are positive integers, we must have either $m+1=7$ and $n+1=17$ or vice versa. So the sum is always 22.

Adding $1$ to both sides of your equation $m+n+mn=118$, you get

$1+m+n+mn=119$

$(1+m)(1+n)=119=17\times 7$

Since $17$ and $7$ are prime, the only way to factor $119$ into two factors (both greater than $1$, since $m,n$ are positive, is $119=17\times 7$.

Hence $1+m=17,\ \ 1+n=7$ or vice versa, or equivalently $m=16,\ \ n=6$.

So the solutions $(16,6)$ and $(6,16)$ are the only ones to your diophantine equation. Therefore $m+n$ is unique and equals $22$.

$mn+m+n=(m+1)(n+1)-1=118$, so you need factors of $119$, which are $7,17$, both of which are prime, and thus the solution is unique.