Hello!
Suppose that the two numbers are both >=2 (if one of the numbers is 1, the problem is trivial). Then both have its unique decomposition into prime factors. If we find this decomposition, which is not simple for large numbers, then LCM must contain the maximum degrees of all prime factors from both numbers.
Consider an example. Let
Then
The maximum degrees are
for
for
and
for
Hence
Another method is to find the greatest common divisor (for example, using Euclidean algorithm) and use the fact that
No comments:
Post a Comment