# Necessary and sufficient conditions for the sum of two numbers to divide their product

How to find necessary and sufficient conditions for the sum of two numbers to divide their product.

• By numbers, do you mean natural numbers?
– Aang
Mar 8 '13 at 8:35
• @Avatar .integer number $\Bbb Z$ Mar 8 '13 at 8:52

There's a solution of this problem in this post on codereview.stackexchange.com. Let me review it, hopefully correctly.

Assume $a, b$ not both zero. Let $d = \gcd(a,b) \ne 0$. Then $a = a' d, b = b' d$, and we have that $a + b = (a' + b') d$ divides $ab = a'b'd^2$, so $a' + b'$ divides $a'b'd$.

Since $a'$ and $b'$ are coprime, if $p$ is a prime divisor of $a'+ b'$, this must divide $d$. This is because $p$ divides $a'b'd$, so it must divide one of the factors. If $p$ divides $a'$, say, then since $p$ divides $a' + b'$, and then $b'$, against the assumption that $a', b'$ are coprime. Thus $a'+b'$ divides $d$.

So the recipe appears to be the following. Choose any coprime pair $a', b'$, and construct $$a = c (a'+b') a', \qquad b = c (a'+b') b',$$ for arbitrary $c$.

• Nice! Yours is much better. Mar 8 '13 at 11:58
• why you let $d=a'+b'$? Mar 8 '13 at 14:14
• @agustin, you're right, bad notation, just fixed, thanks. Mar 8 '13 at 14:33
• This seems to be arguing that "every prime p dividing a'+b' divides d" implies "a'+b' divides d". That doesn't hold, but I believe it can be fixed simply by strengthening the antecedent to "every prime power p^k dividing a'+b' divides d". So I made a suggested edit to change "if p is a prime divisor of" to "if p^k is a prime power dividing". The edit was rejected (harshly), so I'm framing it as a comment instead. Nov 12 '14 at 0:50

If, $\dfrac{ab}{a+b}=n$

Then,

$\dfrac{1}{a}+\dfrac{1}{b}=\dfrac{1}{n}$

I don't know if this is to be considered an answer or not.

• looks necessary and sufficient so looks like an answer to me
– oks
Mar 8 '13 at 9:42
• But it's not particularly elegant, is it? Mar 8 '13 at 9:43
• It's not a matter of elegance, it is just that it does not give a constructive recipe to find all such $a, b$. I have given one in my answer, quoting a post on codereview.stackexchange.com Mar 8 '13 at 10:56

Dividing $\rm\:(A\!+\!B)n = AB\:$ by $\rm\:d=(A,B)\:$ yields $\rm\: (\color{#C00}{a\!+\!b})n = d\color{#C00}{ab},\:$ for $\rm\:[a,b] = [A,B]/d$

$\rm(a\!+\!b,b)\!=\!(a,b)\!=\!1\!=\!(a\!+\!b,a)\:$ so by Euclid $\rm\:(\color{#C00}{a\!+\!b,ab})\!=\!1\:$ so $\rm\:a\!+\!b\mid d,\,$ so $\rm\,(a\!+\!b)c = d.$

Thus $\rm\ [A,B] = d[a,b] = (a\!+\!b)c[a,b].\:$ Indeed $\rm\:A\!+\!B = (a\!+\!b)^2c\mid (a\!+\!b)^2 c^2 ab = AB.$

• Above, vector equations $\rm\ [x,y] = [u,v]\$ mean $\rm\ x=u,\ y=v,\$ and $\rm\ c[u,v] = [cu,cv].\ \$ Mar 8 '13 at 16:20
• You had me fooled that you were Bill Dubuque with this formatting. Jun 15 '16 at 20:31

A simple condition can be found that does not require using the GCD and yet allows you to determine all the solutions. But let me rephrase the problem:

Given any integer $$x$$, find all integers $$y$$ such that $$x+y \mid xy$$.

We know that $$x+y \mid x(x+y)$$ and so

$$x+y \mid x(x+y) - xy = x^2$$. The RHS does not depend on $$y$$ anymore.

Therefore, $$y=d-x$$ for all $$d \mid x^2$$