Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Least common multiple
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Using the greatest common divisor === The least common multiple can be computed from the [[greatest common divisor]] (gcd) with the formula :<math>\operatorname{lcm}(a,b)=\frac{|ab|}{\gcd(a,b)}.</math> To avoid introducing integers that are larger than the result, it is convenient to use the equivalent formulas :<math>\operatorname{lcm}(a,b)=|a|\,\frac{|b|}{\gcd(a,b)} = |b|\,\frac{|a|}{\gcd(a,b)} ,</math> where the result of the division is always an integer. These formulas are also valid when exactly one of {{math|''a''}} and {{math|''b''}} is {{math|0}}, since {{math|1=gcd(''a'', 0) = {{abs|''a''}}}}. However, if both {{math|''a''}}{{math|}} and {{math|''b''}} are {{math|0}}, these formulas would cause [[division by zero]]; so, {{math|1=lcm(0, 0) = 0}} must be considered as a special case. To return to the example above, :<math>\operatorname{lcm}(21,6) =6\times\frac {21}{\gcd(21,6)} =6\times\frac {21} 3 =6\times 7 = 42. </math> There are fast [[algorithm]]s, such as the [[Euclidean algorithm]] for computing the gcd that do not require the numbers to be [[Integer factorization|factored]]. For very large integers, there are even faster algorithms for the three involved operations (multiplication, gcd, and division); see [[Fast multiplication]]. As these algorithms are more efficient with factors of similar size, it is more efficient to divide the largest argument of the lcm by the gcd of the arguments, as in the example above.
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Least common multiple
(section)
Add topic