Find all pairs $(a,b,c)$ of positive integers such that $a+b+c+gcd(a,b)+gcd(b,c)+gcd(c,a)=gcd(a,b,c)+lcm(a,b,c)$

elementary-number-theory

Find all pairs $(a,b,c)$ of positive integers such that $$a+b+c+gcd(a,b)+gcd(b,c)+gcd(c,a)=gcd(a,b,c)+lcm(a,b,c)$$

I've tried to control the both sides of this equation:
$$a+b+c+3\leq a+b+c+gcd(a,b)+gcd(b,c)+gcd(c,a) \leq 2(a+b+c)$$

However I don't know how can I go on. I appreciate any help. Thank you!

Best Answer

The equation you're trying to solve for positive integers is

$$a + b + c + \gcd(a,b) + \gcd(b,c) + \gcd(c,a) = \gcd(a,b,c) + \operatorname{lcm}(a,b,c) \tag{1}\label{eq1A}$$

First, note the symmetry in \eqref{eq1A} means that, for any solution $(a,b,c)$, all permutation of the values are also solutions. Next, with $d = \gcd(a, b, c)$, so $a = da'$, $b = db'$ and $c = dc'$, then \eqref{eq1A} becomes

$$\begin{equation}\begin{aligned} da' + db' + dc' + d\gcd(a',b') + d\gcd(b',c') + d\gcd(c',a') & = d + d\operatorname{lcm}(a',b',c') \\ a' + b' + c' + \gcd(a',b') + \gcd(b',c') + \gcd(c',a') & = 1 + \operatorname{lcm}(a',b',c') \end{aligned}\end{equation}\tag{2}\label{eq2A}$$

Since it's also possible to go from the second line \eqref{eq2A} to the first one, this shows we can, WLOG, just solve \eqref{eq1A} with

$$\gcd(a, b, c) = 1 \tag{3}\label{eq3A}$$

Then, from each specific base solution (e.g., where $a \le b \le c$), the other solutions are $(da, db, dc)$ for all integers $d \ge 1$, along with any reordering of the values (e.g., $(dc, da, db)$).

Next, WLOG, have $c$ be the largest value among $a$, $b$ and $c$. From the LHS of \eqref{eq1A} being $\gt c + 1$ and $\lt 6c + 1$, we then also have

$$\operatorname{lcm}(a,b,c) = m_{3}c, \;\; 2 \le m_3 \le 5 \tag{4}\label{eq4A}$$

Note the factors of $m_3$ must come from $a$ and/or $b$, with the rest of the factors of $a$ and $b$ then also being factors of $c$. Thus, using \eqref{eq4A}, we get that

$$\gcd(a,c)=a_1, \;\; \gcd(b,c) = b_1, \;\; a = m_1a_1, \;\; b = m_2b_1, \\ \gcd(a_1,b_1) = 1, \;\; m_3 = \operatorname{lcm}(m_1, m_2) \tag{5}\label{eq5A}$$

WLOG, have $m_1 \le m_2$. Note \eqref{eq5A} is consistent with Dietrich Burde's comment's linked question Prove $\text{lcm}(a,b,c) = \frac{a \cdot b \cdot c \cdot \gcd(a,b,c)}{\gcd(a,b)\gcd(b,c)\gcd(a,c)}$ since $\frac{a\cdot b\cdot c\cdot\gcd(a,b,c)}{\gcd(a,b)\gcd(b,c)\gcd(a,c)} = \frac{m_{1}a_{1}\cdot m_{2}b_{1}\cdot c}{\gcd(m_{1}, m_{2})\cdot a_{1}\cdot b_{1}} = \left(\frac{m_{1}m_{2}}{\gcd(m_{1}, m_{2})}\right)c$. With $m_{1}m_{2} = \operatorname{lcm}(m_{1},m_{2})\gcd(m_{1},m_{2}) \;\;\to\;\; \operatorname{lcm}(m_{1},m_{2}) = \frac{m_{1}m_{2}}{\gcd(m_{1}, m_{2})}$, then $m_3 = \operatorname{lcm}(m_1, m_2)$, as stated in \eqref{eq5A}.

Using \eqref{eq3A}, \eqref{eq4A} and \eqref{eq5A} in \eqref{eq1A} gives that

$$\begin{equation}\begin{aligned} m_1a_1 + m_2b_1 + c + \gcd(m_1,m_2) + b_1 + a_1 & = 1 + m_3c \\ (m_1+1)a_1 + (m_2+1)b_1 & = (m_3-1)c - (\gcd(m_1,m_2) - 1) \\ (m_1+1)a_1 + (m_2+1)b_1 & = (m_3-1)c - e \\ \end{aligned}\end{equation}\tag{6}\label{eq6A}$$

where $e = \gcd(m_1,m_2) - 1$ for simpler algebra. Note that, if $e = 0$, then since $a_1 \mid c$, we have $a_1 \mid (m_2+1)b_1$, but then $\gcd(a_1,b_1)=1$ means $a_1 \mid m_2+1$. Similarly, $b_1 \mid m_1+1$. For a specific example, consider where $m_3 = 2$ in \eqref{eq4A}, with $m_1 = 1$ and $m_2 = 2$ in \eqref{eq5A}. Then \eqref{eq6A} becomes

$$2a_1 + 3b_1 = c \tag{7}\label{eq7A}$$

As discussed above, we have $a_1 \mid 3$ and $b_1 \mid 2$. Checking these cases, while also ensuring the other conditions are met, gives

  1. With $a_1 = 1$ and $b_1 = 1$, we get $(a,b,c) = (1,2,5)$.
  2. With $a_1 = 1$ and $b_1 = 2$, we have $(a,b,c) = (1,4,8)$. However, $\operatorname{lcm}(1,4,8) = 8 = c$, not $2c$, so this case doesn't work.
  3. Using $a_1 = 3$ and $b_1 = 1$ gives $(a,b,c) = (3,2,9)$.
  4. Using $a_1 = 3$ and $b_1 = 2$ gives $(a,b,c) = (3,4,12)$. However, similar to case #$2$, $\operatorname{lcm}(3,4,12) = 12 = c$, not $2c$, so this case also doesn't work.

Thus, only cases #$1$ and #$3$ above work.

With $e \gt 0$, then using

$$c = ja_1b_1, \;\; j \ge 1 \tag{8}\label{eq8A}$$

in \eqref{eq6A} gives that

$$\begin{equation}\begin{aligned} & (m_1+1)a_1 + (m_2+1)b_1 = (m_3-1)ja_1b_1 - e \\ & (m_3-1)j(m_1+1)a_1 + (m_3-1)j(m_2+1)b_1 = (m_3-1)^2j^2a_1b_1 - (m_3-1)je \\ & (m_3-1)^2j^2a_1b_1 - (m_3-1)j(m_1+1)a_1 - (m_3-1)j(m_2+1)b_1 = (m_3-1)je \\ & ((m_3-1)ja_1 - (m_2+1))((m_3-1)jb_1 - (m_1+1)) = (m_3-1)je + (m_2+1)(m_1+1) \end{aligned}\end{equation}\tag{9}\label{eq9A}$$

An example of using this is with the remaining $m_3 = 2$ case where $m_1 = m_2 = 2$, so $e = \gcd(m_1,m_2) - 1 = 1$, with \eqref{eq9A} then becoming

$$(ja_1 - 3)(jb_1 - 3) = j + 9 \tag{10}\label{eq10A}$$

Note that $a = 2a_1$ and $b = 2b_1$ are both even, so $c$ must be odd for $\gcd(a, b, c) = 1$. Thus, $a_1$, $b_1$ and $j$ must also all be odd. Then $ja_1 - 3$ and $jb_1 - 3$ are both even, so $j + 9$ must be a multiple of $4$. The first such case occurs for $j = 3$, with \eqref{eq10A} now being

$$(3a_1 - 3)(3b_1 - 3) = 12 \;\;\; \to \;\;\; (a_1 - 1)(b_1 - 1) = 4 \tag{11}\label{eq11A}$$

The only solution here is $a_1 - 1 = b_1 - 1 = 2 \;\; \to \;\; a_1 = b_1 = 3$, but that contradicts the requirement in \eqref{eq5A} that $\gcd(a_1, b_1) = 1$. The next value to check is $j = 7$, with this resulting in

$$(7a_1 - 3)(7b_1 - 3) = 16 \tag{12}\label{eq12A}$$

Since $7a_1 - 3 \ge 7(1) - 3 = 4$, and similarly for $b_1$, this means the only solution is $a_1 = b_1 = 1$, giving the valid base solution of $(a, b, c) = (2, 2, 7)$.

We don't need to try any larger $j$ values as they require $a_1 \lt 1$ and $b_1 \lt 1$. Another way to see this is that, since $ja_1 - 3$ and $jb_1 - 3$ are strictly increasing functions in $a_1$ and $b_1$, respectively, we get from \eqref{eq10A} that

$$\begin{equation}\begin{aligned} (ja_1 - 3)(jb_1 - 3) & \ge (j - 3)(j - 3) \\ j + 9 & \ge j^2 - 6j + 9 \\ 0 & \ge j^2 - 7j \\ 0 & \ge j(j - 7) \end{aligned}\end{equation}\tag{13}\label{eq13A}$$

which shows $j \le 7$.

This completes the handling for $m_3 = 2$. Dealing with the remaining $m_3$ values, i.e., $3 \le m_3 \le 5$, is similar to what I've shown above.

Related Question