The GCD is
, so
divides both
and
. For some
and
we can write


Expanding the right sides, we get


also divides the LCM, so

and expanding gives

Matching up all the coefficients, we have

All the unknowns are integers, and we have the prime factorization 6 = 2×3 that also satisfies 5 = 2 + 3.
• If
and
, then
,
, and
.
• If
and
, then there is no solution for
since

but 3 ≠ 2 - 1 = 1.
It follows that
.