[Math] Prove that either $m$ divides $n$ or $n$ divides $m$ given that $\operatorname{lcm}(m,n) + \operatorname{gcd}(m,n) = m + n$

divisibilityelementary-number-theorygcd-and-lcmnumber theory

We are given that $m$ and $n$ are positive integers such that $\operatorname{lcm}(m,n) + \operatorname{gcd}(m,n) = m + n$.

We are looking to prove that one of numbers (either $m$ or $n$) must be divisible by the other.

Best Answer

Hint $ $ For $\,x = \gcd(m,n),\ {\rm lcm}(m,n) = mn/x,\,$ and your equation is $\,(x-m)(x-n) = 0.$ Thus either $\,x = \gcd(m,n) = m,\,$ so $\,m\mid n,\ $ or $\,x = \gcd(m,n) = n,\,$ so $\,n\mid m.$