Introduction

Great progress so far in Finding the Lowest Common Multiple! We are already at lesson three of five in this course. Over the first two lessons, you explored common multiples and then learned how to find the LCM by listing multiples until the first shared value appeared. That listing method is clear and reliable, but it can become slow when numbers get larger. Today, you will learn a more efficient approach: finding the LCM using prime factorisation.

When Listing Reaches Its Limits

Consider trying to find LCM(48,72)\text{LCM}(48, 72) by listing. You might need to write out many multiples of each number before spotting the first match. For even bigger numbers, the lists grow quickly and the process becomes tedious.

Prime factorisation gives us a shortcut that works directly with the structure of the numbers rather than scanning long lists. As you may recall from earlier in this learning path, every whole number greater than 11 can be written as a unique product of prime factors. That breakdown is exactly the tool we will use now.

The Core Idea

Here is the key insight: for a number to be a multiple of 1212, it must contain at least the same prime factors that 1212 has, each raised to at least the same power. Since 12=22×312 = 2^2 \times 3, any multiple of 1212 needs at least two s and at least one among its prime factors. The same logic holds for any number.

The Method Step by Step

Let us find LCM(12,18)\text{LCM}(12, 18) using prime factorisation. Imagine two rotating displays in a shop window: one completes a cycle every 1212 seconds, the other every 1818 seconds. To find when both displays first reset together, we need the LCM of 1212 and 1818.

Step 1 — Factorise each number.

A Worked Example with Different Primes

Things get especially interesting when two numbers do not share all of their prime factors. Let us try LCM(60,72)\text{LCM}(60, 72).

Factorise:

60=22×3×560 = 2^2 \times 3 \times 5
Extending to Three Numbers

The method scales naturally. Suppose three rotating shift schedules repeat every 88, 1212, and 1515 days. To find when all three schedules first align, we need LCM(8,12,15)\text{LCM}(8, 12, 15). Start by factorising all three:

8=23
Why Shared Primes Alone Are Not Enough

You might wonder: "Can I save time and use only the primes that the numbers have in common?" This is a natural question, especially if you recall that the Highest Common Factor (HCF) works by taking shared primes at their lowest powers. The LCM, however, goes in the opposite direction.

Consider 12=22×312 = 2^2 \times 3 and 10=2×510 = 2 \times 5. The only shared prime is . If we built our result from shared primes alone, we would get (the HCF). Even if we took the highest power of that shared prime, , it would not be a common multiple. That product is far too small because it is missing the factors of and .

Conclusion and Next Steps

In this lesson, you learned a faster way to find the LCM: factorise each number into primes, select every prime that appears in any factorisation at its highest power, and multiply those together. We also explored why this approach requires all primes — omitting a prime that is unique to one number means the result cannot be a multiple of that number.

Now it is time to put this technique to work! The upcoming practice tasks will walk you through the method piece by piece: first selecting the correct highest powers, then computing full LCMs for pairs and trios of numbers, and finally explaining the reasoning in your own words. Let's build that confidence one step at a time.

Sign up
Join the 1M+ learners on CodeSignal
Be a part of our community of 1M+ users who develop and demonstrate their skills on CodeSignal