MathSwitch Move it, and the math shows.

Primes, GCF and LCM

Break a number into a product of primes, and you can see at a glance how many factors it has, the biggest tile that fits, and when two cycles meet again. Sieve the primes up to 100, split 360 into a factor tree, tile a board, and run 100 years to test one idea about why some cicadas come out every 13 or 17 years.

Prime factorization: breaking a number into primes

A prime is a whole number greater than 1 whose only factors are 1 and itself: 2, 3, 5, 7, 11, 13… Every composite number can be written as a product of primes in exactly one way, apart from order (4 = 2 × 2). That is its prime factorization. The number 1 is neither prime nor composite.

It shows a number’s “ingredients.” From 360 = 2³ × 3² × 5 you can read how many factors it has, and its greatest common factor (GCF) and least common multiple (LCM) with another number. A repeated prime is written as a power: 2 × 2 × 2 = 2³.

Key ideas
  • Factor by dividing by the smallest prime you can until the quotient is prime: 360 = 2³ × 3² × 5.
  • If a = pm × qn (p, q different primes), it has (m + 1) × (n + 1) factors, with one more factor in the product for each extra prime: 360 has 4 × 3 × 2 = 24.
  • GCF: shared primes, each with the smaller exponent. 12 = 2² × 3, 18 = 2 × 3² → 2 × 3 = 6.
  • LCM: every prime that appears, each with the larger exponent. 12 and 18 → 2² × 3² = 36.
  • If the GCF is 1, the LCM is just the product of the two numbers.

Try it yourself

Example 1. Find the prime factorization of 72 and how many factors it has.

Show solution

72 = 2 × 36 = 2 × 2 × 18 = 2 × 2 × 2 × 9 = 2³ × 3². It has (3 + 1) × (2 + 1) = 12 factors: 1, 2, 3, 4, 6, 8, 9, 12, 18, 24, 36, 72.

Example 2. A board is 16 cm by 24 cm. What is the side of the largest square tile that covers it with no gaps?

Show solution

16 = 2⁴ and 24 = 2³ × 3. The shared prime with the smaller exponent is 2³ = 8. An 8 cm tile fits 2 across and 3 down: 6 tiles.

Example 3. One bus leaves every 8 minutes, another every 12 minutes. Both leave at 9:00. When do they next leave together?

Show solution

8 = 2³ and 12 = 2² × 3, so the LCM is 2³ × 3 = 24. They leave together at 9:24, not 8 × 12 = 96 minutes later.

Common mistakes

  • Calling 1 prime: 1 has only one factor, so it isn’t prime.
  • Adding exponents to count factors: 360 = 2³ × 3² × 5 has (3 + 1)(2 + 1)(1 + 1) = 24 factors, not 3 + 2 + 1 = 6, because each prime can also be used 0 times.
  • Multiplying to get the LCM: the LCM of 8 and 12 is not 96. The shared 2² must not be counted twice.
  • Stopping early: 360 = 4 × 90 still contains composite numbers, so it isn’t finished.

Going further

About 2,200 years ago, Eratosthenes sifted out primes with a “sieve”: keep 2 and cross out its multiples, then do the same with 3, and so on. Up to 100, the primes below √100 = 10 are enough. Primes also keep online payments safe: multiplying two huge primes is easy, but factoring the product back takes even computers an extremely long time. And North America’s periodical cicadas come out every 13 or 17 years; a widely cited hypothesis (one of several) is that prime cycles rarely line up with predators that peak every 2 to 6 years.

Scenes in this topic

Where it fits

Students sort numbers into prime and composite in grade 4 and find the GCF and LCM of two numbers in grade 6. The ideas return in fractions and, later, in factoring in algebra.

FAQ

Is there a largest prime?
No. If there were only finitely many, multiplying them all and adding 1 leads to a contradiction. The largest prime found so far has tens of millions of digits.
2 is even. Is it prime?
Yes. Only 1 and 2 divide it evenly, and it’s the only even prime.
What are the GCF and LCM used for?
The GCF splits things evenly (tiles, equal packs). The LCM finds when things line up again (buses, gears, common denominators).

Last updated 2026-11-08

Sieve the primes to 100

← Primes, GCF and LCM

Teaching tip. This is the Sieve of Eratosthenes. Take out 1 first, since it isn’t prime. Then keep 2 and cross out its multiples, keep 3 and cross out its multiples, and so on. Up to 100 you can stop after the multiples of 7: the next number left standing is 11, and the first multiple of 11 you would still need to check is 11 × 11 = 121, which is past 100. That leaves 25 primes, about 1 in 4.

Teaching tip. Divide by the smallest prime first and keep splitting until only leaves (primes) are left. 360 = 2³ × 3² × 5. Every factor comes from choosing how many times to use each prime: 2 from 0 to 3 times, 3 from 0 to 2 times, 5 zero times or once. So there are (3 + 1) × (2 + 1) × (1 + 1) = 24 factors. Many students simply add the exponents, so fill in the table together and point out why you add 1 (a prime can be used 0 times).

The largest square tile

← Primes, GCF and LCM

Teaching tip. For square tiles to cover the board with no gaps, the tile’s side has to divide both the width and the length evenly. Such numbers are common factors, and the biggest one is the greatest common factor. With 12 = 2² × 3 and 18 = 2 × 3², the shared part 2 × 3 = 6 gives the biggest tile, and (12 ÷ 6) × (18 ÷ 6) = 6 tiles fit. The short side (12) doesn’t divide the long side (18), so a tile that size leaves a gap.

13- and 17-year cicadas

← Primes, GCF and LCM

Teaching tip. Periodical cicadas in North America spend 13 or 17 years underground, then come out all at once. Suppose predators peak every 2 to 6 years. A 12-year cycle runs into predators every time, because 12 is a common multiple of 2, 3, 4 and 6. With a prime cycle like 13 years, the LCM with each predator cycle grows to 26, 39, 52… so they rarely meet. Be sure to mention that this is a widely cited hypothesis in biology, one explanation among several, not a settled fact.