Difference between revisions of "Least common multiple"

m (proofreading)
(How to find)
 
(7 intermediate revisions by 5 users not shown)
Line 1: Line 1:
The '''least common multiple''' (LCM) of two or more numbers is the lowest multiple common to both.  Any set of numbers has an infinite amount of common [[multiples]], but only one LCM.
+
The '''least common multiple''' ('''LCM''') of two or more [[positive integer]]s is the smallest [[integer]] which is a [[multiple]] of all of them.  Any [[finite]] [[set]] of integers has an [[infinite]] number of [[common multiple]]s, but only one LCM. The LCM of a set of numbers <math>\{a_1,a_2,\cdots,a_n\}</math> is conventionally represented as <math>[a_1,a_2,\ldots,a_n]</math>.
 +
 
 +
== Video on Least Common Multiple ==
 +
 
 +
[https://youtu.be/1lfwMN1cUwY Least Common Multiple]
  
 
== How to find ==
 
== How to find ==
 +
=== Brute force ===
 
The most primitive way to find the LCM of a set of numbers is to list out the multiples of each until you find a multiple that is common to all of them. This is a tedious method, so it is usually only used when the numbers are small. For example, suppose we wanted to find the LCM of two numbers, 4 and 6. We would begin by listing the multiples of 4 and 6 until we find the smallest number in both lists, as shown below.
 
The most primitive way to find the LCM of a set of numbers is to list out the multiples of each until you find a multiple that is common to all of them. This is a tedious method, so it is usually only used when the numbers are small. For example, suppose we wanted to find the LCM of two numbers, 4 and 6. We would begin by listing the multiples of 4 and 6 until we find the smallest number in both lists, as shown below.
  
Line 9: Line 14:
  
 
12 is the LCM of 4 and 6.
 
12 is the LCM of 4 and 6.
 +
=== Using prime factorization ===
 +
The LCM of two or more numbers can also be found using [[prime factorization]].  In order to do this, factor all of the numbers involved.  For each [[prime number]] which divides any of them, take the largest [[exponentiation | power]] with which it appears, and multiply the results together.  For example, to find the LCM of 8, 12 and 15, write:
  
The LCM of two numbers can be found more easily by first finding the [[Greatest_common_divisor | greatest common divisor (GCD)]]. Once the GCD is known, the LCM is calculated by the following equation, <math> LCM(a, b) = \frac{a \times b}{GCD(a, b)} </math>.
+
<math>8 = 2^3</math>
  
Let's use the above example again. The GCD of 4 and 6 is 2, since <math> 4 = 2^2 </math> and <math> 6 = 2 \times 3</math>. Using the above equation, we find <math> LCM(4, 6) = \frac{4 \times 6}{2} = \frac{24}{2} = 12 </math>.
+
<math>12 = 2^2\cdot 3^1</math>
  
The LCM of two or more numbers can also be found using [[prime factorization]].  Try to find how this and the method above are related.  The best way to explain this method is by example. 
+
<math>15 = 3^1\cdot 5^1</math>
Using 8 and 12:
 
  
<math>12=2^2\times3</math><br>
+
Three primes appear in these factorizations, 2, 3 and 5.  The largest power of 2 that appears is <math>2^3</math>; the largest power of 3 that appears is <math>3^1</math>; and the largest power of 5 that appears is <math>5^1</math>.  Therefore the LCM, <math>LCM(8, 12, 15) = 2^3\cdot 3^1\cdot 5^1 = 120</math>.
<math>\ 8=2^3</math><br>
 
Now we find prime factors that are common to both:
 
  
<math>\ 2^2</math><br>
+
=== Using the GCD ===
(Notice this is GCD.)
+
The LCM of two numbers can be found more easily by first finding their [[greatest common divisor]] (GCD). Once the GCD is known, the LCM is calculated by the following equation, <math> LCM(a, b) = \frac{a \cdot b}{GCD(a, b)} </math>.  
Now find those not common:
 
  
<math>2\times3</math><br>
+
Let's use our first example. The GCD of 4 and 6 is 2.  Using the above equation, we find <math> LCM(4, 6) = \frac{4 \cdot 6}{2} = \frac{24}{2} = 12 </math>, just like we expected.
Now we multiply:
 
  
<math>2^2\times2^1\times3</math><br>
+
[[Category:Definition]]
This equals '''24''', and we have our LCM.
+
[[Category:Number theory]]

Latest revision as of 14:21, 24 December 2020

The least common multiple (LCM) of two or more positive integers is the smallest integer which is a multiple of all of them. Any finite set of integers has an infinite number of common multiples, but only one LCM. The LCM of a set of numbers $\{a_1,a_2,\cdots,a_n\}$ is conventionally represented as $[a_1,a_2,\ldots,a_n]$.

Video on Least Common Multiple

Least Common Multiple

How to find

Brute force

The most primitive way to find the LCM of a set of numbers is to list out the multiples of each until you find a multiple that is common to all of them. This is a tedious method, so it is usually only used when the numbers are small. For example, suppose we wanted to find the LCM of two numbers, 4 and 6. We would begin by listing the multiples of 4 and 6 until we find the smallest number in both lists, as shown below.

4 8 12

6 12

12 is the LCM of 4 and 6.

Using prime factorization

The LCM of two or more numbers can also be found using prime factorization. In order to do this, factor all of the numbers involved. For each prime number which divides any of them, take the largest power with which it appears, and multiply the results together. For example, to find the LCM of 8, 12 and 15, write:

$8 = 2^3$

$12 = 2^2\cdot 3^1$

$15 = 3^1\cdot 5^1$

Three primes appear in these factorizations, 2, 3 and 5. The largest power of 2 that appears is $2^3$; the largest power of 3 that appears is $3^1$; and the largest power of 5 that appears is $5^1$. Therefore the LCM, $LCM(8, 12, 15) = 2^3\cdot 3^1\cdot 5^1 = 120$.

Using the GCD

The LCM of two numbers can be found more easily by first finding their greatest common divisor (GCD). Once the GCD is known, the LCM is calculated by the following equation, $LCM(a, b) = \frac{a \cdot b}{GCD(a, b)}$.

Let's use our first example. The GCD of 4 and 6 is 2. Using the above equation, we find $LCM(4, 6) = \frac{4 \cdot 6}{2} = \frac{24}{2} = 12$, just like we expected.

Invalid username
Login to AoPS