# a+b=a*b, a-b=? if a and b are positive integers

So this is a question off Facebook (I know). $a, b$ are positive integers. The answer to the problem turns out to be $a-b=0$ as the only two obvious solutions are $a=b=0, 2$ (and we select two as it can't be zero).

My question is how do we prove this? I was trying

$a+b=ab$

$\dfrac{a}{a-1}=b$

But I can't proceed by substituting this in $a-b$ and solving the polynomial as I would have to first assume that $a-b=0$.

How do we prove this? How can we prove that the only value $a$ and $b$ can take is $2$ (and hence $a-b=0$)? Alternatively, how can we prove that if $a-b$ is non-zero, then $a$ and $b$ aren't integers? How can we prove that there are infinitely many solutions if the constraint is shifted to real numbers?

• Hint: $a = b (a-1)$ and $\gcd(a, a-1) = 1$. – dxiv Sep 7 '16 at 3:37
• If a = 0 then b=b+a=0. Likewise if b=0 then a =0. Assume neither are zero. If prime p^n |b then p^n|ab =a+b so p^n|a. And vice versa. So a and b have same prime factorization. So a=b and 2a =a^2. a=b=2 is other solution. – fleablood Sep 7 '16 at 3:54
• Btw, a=b=0 is not a case of a and b being positive integers. So a=b=2 is only solution. – fleablood Sep 7 '16 at 3:56
• Got that part! I was struggling with proving it. – learning Sep 7 '16 at 3:57
• ...or if a,b are integers gcd(a,a-1)=1. So if a/(a-1) is integer a-1=1 so a =2 and b=2. – fleablood Sep 7 '16 at 3:58

$a+b = ab\\ a(1-b) +b = 0\\ a = \frac {b}{b-1}$

$b-1$ divides $b$ when $b = 0$ or $b-1 = 1$ i.e. everything divides $0,$ and $1$ divides everything.

$\gcd (b,b-1) = 1$ which can be demonstrated by the Euclidean algorithm.

There is no $b>2$ such that $(b-1)$ divides $b.$

• I didn't know that result, but seeing it in front of me makes it seem obvious. – learning Sep 7 '16 at 3:41

Since $a =b(a-1),\;b|a$, and since $b=a(b-1),\;a|b$.

Therefore $a=b$, so $2a=a^2\implies a=2=b$.

• Are these number theoretic results? I do not have any knowledge of Number Theory, though it makes sense that it would be used here. This seems like a useful thing to know. – learning Sep 7 '16 at 3:51
• Yes, this uses the definition of divisibility and the fact that if $a|b$, then $a\le b$. – user84413 Sep 7 '16 at 3:54

$$a+b=ab$$ $$\frac{a+b}{ab}=1$$ This approach prevents either $a$ or $b$ being $0$. $$\frac1a+\frac1b=1$$ The only integer values of $a,b$ that satisfy this are $a=b=2$ ($a\gt2\implies1\lt b\lt2$).

We can see $a=b$ more directly by letting $b=ka$. Then $a(k+1)=ka^2\to a(k+1-ka)=0$. So either $a=0$ (and so $a=b$) or $a=\frac{k+1}{k}$. As $a\in\mathbb{Z}, k=1\to a=b=2$.

If we drop the constraint that $a\in\mathbb{Z}$, then for example consider $k=2$. Then $a=\frac32, b=3, a+b=ab=\frac92$.

Finally $a-b=ab-2b=b(a-2)$ which is only zero if $b=0$ or $a=2$.

As $a$ and $b$ are positive $a=b=0$ is not an acceptable solution.

As you note: $ab=a+b; ab-b =a;b=a/(a-1)$ if $a-1\ne 0$. So $a-1|a$ so $a-1|a-(a-1)=1$.

So $a-1=1$ and $a=2$ and $b=2$

... unless $a-1=0$ but then we get the contradiction $1*b=1+b$