2

When $ab/(a+b)$ is an integer, where $a,b$ are positive integers?

clear;
maxn:=30;
for a in [1..maxn] do
for b in [a..maxn] do
q1:=a*b; q2:=a+b;
if q1 mod q2 eq 0 then
  print a,b,q1 div q2;
end if;
end for;
end for;

the Magma code given above outputs the following.

2 2 1
3 6 2
4 4 2
4 12 3
5 20 4
6 6 3
6 12 4
6 30 5
8 8 4
8 24 6
9 18 6
10 10 5
10 15 6
12 12 6
12 24 8
14 14 7
15 30 10
16 16 8
18 18 9
20 20 10
20 30 12
21 28 12
22 22 11
24 24 12
26 26 13
28 28 14
30 30 15

So I conjectrue that $\frac{ab}{a+b}$ is an integer if and only if $\frac{a}{d}+\frac{b}{d} \mid d$, where $d=\gcd(a,b)$. It is true if $a=b$.

If $\frac{a}{d}+\frac{b}{d} \mid d$, then $$\frac{ab}{a+b}=\frac{a}{d} \cdot \frac{b}{d}\cdot \frac{d}{\frac{a}{d}+\frac{b}{d}}$$ is a product of three positive integers and hence is an integer.

Conversely, i.e., $\frac{ab}{a+b}$ is an integer. Let $b=\frac{p}{q}\cdot a$ with $\gcd(p,q)=1$ where $p=\frac{b}{d}$, $q=\frac{a}{d}$ and $d=\gcd(a,b)$. Then $$\frac{ab}{a+b}=\frac{a\cdot \frac{p}{q}\cdot a }{(1+\frac{p}{q})a}=\frac{ap}{p+q}$$ Since $\gcd(p,p+q)=\gcd(p,q)=1$, it has $p+q \mid a$. Similarly, it has $p+q \mid b$. As a result, $p+q \mid \gcd(a,b)$, i.e. $\frac{a}{d}+\frac{b}{d} \mid d$. It completes the proof.

Bill Dubuque
  • 272,048
Zongxiang Yi
  • 1,174
  • 2
    Related: https://math.stackexchange.com/questions/530915/if-1-a-1-b-1-c-where-a-b-c-are-positive-integers-with-no-common-fact – Martin R May 10 '20 at 14:00
  • $\dfrac{ab}{a+b}=n \overset{a\to u+v\b\to u-v}{\implies} (u - n)^2 - v^2 = n^2$ – Dmitry Ezhov May 10 '20 at 14:09
  • @MartinR thanks for the reference although the conditions are a bit different. For example, $a=4$, $b=4$, then $\frac{ab}{a+b}=2$ while $a+b=8$ is not a square number. That reference disscuss the case that $\gcd(a,b,\frac{ab}{a+b})=1$. Let me think about the case that the conditon does not hold. – Zongxiang Yi May 10 '20 at 14:23

3 Answers3

3

The conjecture is true - just cancel the gcd $(A,B) =:c\,$ to reduce to the simpler coprime case.

$\begin{align}{\bf Theorem}\ \ \ A\!+\!B\mid AB &\iff\, a+b\mid c,\ \ \ \ a = A/c,\, b = B/c \\[.4em] &\ \smash[t]{\overset{\times\ c}\iff}\ \:\! A\!+\!B\mid (A,B)^2\end{align}$

Proof $\,\ \dfrac{AB}{A+B} = \dfrac{acbc}{ac+bc} = \dfrac{abc}{a+b}\ $ is an integer

$\ \iff\, a\!+\!b\mid \color{#0a0}a\color{#c00}bc\iff a\!+\!b\mid c,\, $ by $\,(a\!+\!b,\color{#0a0}a)={\underbrace{(a,b)}_{\large 1}} = (a\!+\!b,\color{#c00}b)\,$ by Euclid

Remark $ $ Generally, as explained here, problems like this are usually simplified by reducing to coprime case by cancelling the gcd throughout (using gcd & lcm distributive laws).

Bill Dubuque
  • 272,048
1

We can do way better.

Thm. We have $a+b\mid ab$ if and only if $a=\dfrac{u+v+w}{2}$ and $b=\dfrac{-u+v+w}{2}$, where $u,v,w\in\mathbb{Z}$ such that $v$ is even and $u^2+v^2=w^2.$

Since we know how to describe completely Pythagorean triples, this gives a full description of the solutions.

Proof. If $a+b\mid ab$, there exists $m\in\mathbb{Z}$ are integers such that $ab=ma+mb$. Hence $(a-m)(b-m)=m^2$, that is $(a+b-2m)^2-(a-b)^2=4m^2$. Now set $u=a-b,v=2m,w=a+b-2m$. Notice that $a=\dfrac{u+v+w}{2}$ and $b=\dfrac{-u+v+w}{2}$

Conversely, if $u,v,w$ satisfies the conditions of the theorem, then $u$ and $w$ necessarily have smae parity, and $a=\dfrac{u+v+w}{2}$ and $b=\dfrac{-u+v+w}{2}$ are then integers (since $v$ is even). Moreover, $a+b=v+w$ and $ab=\dfrac{(v+w)^2-u^2}{4}$. Now $(v+w)^2-u^2=v^2+w^2+2vw-u^2=2v^2+2vw=2v(v+w)$. Hence $ab=\dfrac{v}{2}(v+w)=\dfrac{v}{2}(a+b)$. Thus, $a+b\mid ab$ since $v$ is even.

GreginGre
  • 15,028
0

Let $\gcd(a,b)=d$, $a=du$ and $b=dv$.

Thus, $\gcd(u,v)=1$ and $$\frac{ab}{a+b}=\frac{ab+b^2-b^2}{a+b}=b-\frac{dv^2}{u+v},$$ which says $$d=k(u+v)$$ and we obtain: $$(a,b)=(k(u^2+uv),k(v^2+uv)),$$ where $u,$ $v$ and $k$ are integers, $k\neq0$ and $\gcd(u,v)=1.$