0

Given a,b,c are positive integers. Find all $(a;b;c)$ satisfy: $$\gcd(a;b)+ \gcd(b;c)+ \gcd(c;a)= \frac{(a+b+c)}{2}$$

I have given some thoughts about RHS, as $a/2, b/2, c/2$ are pretty big as they can possibly be the second highest divisors of a, b, c respectively. So I actually tried $b=ka/2$, $c=la/2$ ($k,l$ are odd) so that $\gcd(a;b)=a/2$. However, after calculating I found that $k,l$ can’t be positive integers, so I reckon $\gcd(a;b)$ isn’t $a/2$ and the same for $\gcd(b,c)$ and $\gcd(c,a)$.

I stuck at that point. Can you guys help me?

1 Answers1

2

Finding the answer

It's very easy to strongly conjecture the answer if we don't need proof. (Then I include a full proof below.)

First, observe that if $(a,b,c)$ is a solution then $(ka, kb, kc)$ is also a solution for any $k \in \mathbb{N}$, so we can assume WOLOG that $\gcd(a,b,c) = 1$. Second, just check all smallish cases using a computer. I used Python:

from math import gcd
M = 300  # We'll check all a,b,c <= this cutoff.
for a in range(1, M+1):
    for b in range(a, M+1):
        for c in range(b, M+1):
            if gcd(gcd(a,b),c) == 1 and (gcd(a,b) + gcd(b,c) + gcd(a,c)) * 2 == a+b+c:
                print(a,b,c)

The output of this program makes it look very probably that the primitive solutions are: $(1,2,3)$, $(1,3,6)$, plus $(4,a,a)$ for any $a$ with $\gcd(4,a)=1$. (Reorderings of these terms are also solutions.)

Proving the answer

This gets pretty messy! I'll break into the following cases:

Case 1: $a = b$

We assumed $\gcd(a,b,c) = 1$, so $\gcd(a,c) = 1$. That means we need $2a + c = 2(2 + a) = 4 + 2a$, so $c = 4$. In other words the solution must take the form $(4,a,a)$ with $\gcd(4,a) = 1$. Any tuple of that form works, which gives infinitely many solutions.

Case 2: $a \mid b$ and $a \ne b$

Let $b = ka$. Define $g = \gcd(k,c)$, $c = gz$, $k = gy$. We have $\gcd(a,b) = a$, $\gcd(a,c) = 1$ (since otherwise $\gcd(a,b,c)$ would be bigger than 1) and $\gcd(b,c) = g$. The equation becomes $$\begin{align} 2(a + g + 1) &= a + gya + gz \\ 2g+2 &= (gy-1)a + gz \\ g(ay + z - 2) &= a + 2 \\ a(gy - 1) &= 2 + 2g - zg \end{align}$$

We can use those last two lines to check some rapid-fire subcases:

  • If $z \ge 5$ then $g(ay+z-2) \ge g(ay+3) \ge a+3$, so there's no hope. Thus $z \le 4$.
  • If $y \ge 6$ then $g(ay+z-2) = g(2a + z + (y-2)a-2) \ge g(2a + z + 2) > 2a+2$. Thus we must have $y \le 5$.
  • We must have $ay+z-2 > 0$, and $ay+z-2 \ge a-1$. The largest possible ratio of $\frac{a+2}{\max(1, a-1)}$ is 3, so we must have $g \le 3$.
  • Using the observations above, we have $2 + 2g - zg \le 2 + 6 - 1 = 7$. Using the assumption $a \ne b$ and thus $gy > 1$, we have $a(gy-1) \ge a$. Therefore we must have $a \le 7$.

It's possible to be a little more careful and prove tighter bounds, but anyway the above observations combine to tell us $a \le 7$, $g \le 3$, $y \le 5$, $z \le 4$. That leaves only 420 cases to check, which takes no time at all in Python or any other language you choose. The only solutions in this category are $(a,b,c) = (1,2,3), (1,3,2), (1,4,1), (3,6,1)$. Discarding $(1,3,2)$ which is just a rearrangement and $(1,4,1)$ which is of the form $(4,a,a)$ from the case above, the only interesting new solutions here are $(1,2,3)$ and $(1,3,6)$.

Here's the Python code I used to check the 420 cases:

from math import gcd
for a in range(1, 8):
    for g in range(1, 2):
        for y in range(1, 6):
            for z in range(1, 5):
                b = g*y*a
                c = g*z
                if gcd(gcd(a,b),c) != 1: continue
                if a == b: continue
                if g*(a*y + z - 2) == a + 2: print(a,b,c)

Case 3: No two of $a,b,c$ divide each other

Let $a \le b \le c$ and note $\gcd(a,b) \le \frac{a}{2}$, $\gcd(b,c) \le \frac{b}{2}$, and $\gcd(a,c) \le \frac{a}{2}$. Then $$\begin{align} 2(\gcd(a,b) + \gcd(b,c) + \gcd(a,c)) &\le 2\left( \frac a 2 + \frac b 2 + \frac a 2 \right) \\ &= 2a+b < a+b+c. \end{align}$$

Thus there can't be any solutions in this case.

Finale: Combining the results from the cases

The full set of solutions $(a,b,c)$ exactly contains:

  • $(1,2,3)$ and $(1,3,6)$
  • Any tuple $(4,a,a)$ where $\gcd(4,a) = 1$
  • Any rearranged and/or scaled version of one of the above options

(Of course, we were pretty sure this would be the result after 1 minute of coding in Python at the very top of this answer. But now we've actually proved it!)

David Clyde
  • 5,251