Finding the LCM of Two or More Numbers

April 12, 2026

Problem

Find LCM(12, 18, 20) using prime factorization. Show the Venn diagram of prime factors.

Explanation

What is the LCM?

The least common multiple (LCM) of two or more integers is the smallest positive integer that is a multiple of all of them. For example, LCM(4, 6) = 12 because 12 is the smallest number divisible by both 4 and 6.

Method 1: Prime Factorization

Step 1 — Find the prime factorization of each number:

12=22×312 = 2^2 \times 3 18=2×3218 = 2 \times 3^2 20=22×520 = 2^2 \times 5

Step 2 — For each prime, take the highest power that appears in any factorization:

  • Prime 2: highest power is 222^2 (from 12 and 20)
  • Prime 3: highest power is 323^2 (from 18)
  • Prime 5: highest power is 515^1 (from 20)

Step 3 — Multiply these highest powers:

LCM=22×32×5=4×9×5=180\text{LCM} = 2^2 \times 3^2 \times 5 = 4 \times 9 \times 5 = 180

LCM(12,18,20)=180\boxed{\text{LCM}(12, 18, 20) = 180}

Verification: 180/12=15180/12 = 15 ✓, 180/18=10180/18 = 10 ✓, 180/20=9180/20 = 9 ✓.

Method 2: Using the GCD (for two numbers)

LCM(a,b)=a×bGCD(a,b)\text{LCM}(a, b) = \frac{a \times b}{\text{GCD}(a, b)}

Example: LCM(12, 18) = (12×18)/GCD(12,18)=216/6=36(12 \times 18) / \text{GCD}(12, 18) = 216 / 6 = 36.

Then LCM(36, 20) = (36×20)/GCD(36,20)=720/4=180(36 \times 20) / \text{GCD}(36, 20) = 720 / 4 = 180 ✓.

Method 3: Listing multiples (small numbers only)

Multiples of 12: 12, 24, 36, 48, 60, 72, 84, 96, 108, 120, 132, 144, 156, 168, 180, ... Multiples of 18: 18, 36, 54, 72, 90, 108, 126, 144, 162, 180, ... Multiples of 20: 20, 40, 60, 80, 100, 120, 140, 160, 180, ...

First common multiple = 180 ✓.

GCD vs LCM

  • GCD picks the minimum power of each prime: GCD(12,18)=21×31=6\text{GCD}(12, 18) = 2^1 \times 3^1 = 6.
  • LCM picks the maximum power of each prime: LCM(12,18)=22×32=36\text{LCM}(12, 18) = 2^2 \times 3^2 = 36.

They always satisfy: GCD(a,b)×LCM(a,b)=a×b\text{GCD}(a,b) \times \text{LCM}(a,b) = a \times b.

Real-world uses

  • Adding fractions: LCD (least common denominator) = LCM of denominators. 112+118\frac{1}{12} + \frac{1}{18} needs LCD = LCM(12, 18) = 36.
  • Scheduling: Two events repeat every 12 and 18 days. They coincide every LCM(12, 18) = 36 days.

Try it in the visualization

Enter two or three numbers. The Venn diagram shows overlapping prime factors. The LCM takes the union (highest power of each prime), while the GCD takes the intersection (lowest power).

Interactive Visualization

Parameters

12.00
18.00
20.00
Your turn

Got your own math or physics problem?

Turn any problem into an interactive visualization like this one — powered by AI, generated in seconds. Free to try, no credit card required.

Sign Up Free to Try It30 free visualizations every day