Skip to content
Tutorials Center
My learning

Topics

Lesson 26 of 39 · Factors, Multiples and Primes

Prime Factorization

Break any whole number into primes with factor trees and repeated division, write it in index form and use it to count factors and spot square numbers.

Every whole number greater than 1 can be written as a product of primes, and in exactly one way (apart from the order of the factors). This is called the Fundamental Theorem of Arithmetic. Writing a number as a product of primes is prime factorization.

For example, 60 = 2 × 2 × 3 × 5. No matter how you break 60 down, you always end with two 2s, one 3 and one 5. Prime factorization is like a number's fingerprint, and it makes finding HCF and LCM, simplifying fractions and working with roots much easier.

Factor trees

A factor tree splits a number into any two factors, then keeps splitting every composite branch until only primes remain.

flowchart TD
  A["60"] --> B["6"]
  A --> C["10"]
  B --> D["2"]
  B --> E["3"]
  C --> F["2"]
  C --> G["5"]

A factor tree for 60. The leaves, 2, 3, 2 and 5, are all prime.

A different tree, 60 = 4 × 15, ends with the same primes. The tree can look different; the final primes never do.

Repeated division

A tidier method divides by the smallest possible prime each time.

Example 1. Factorize 360.

Text
360 ÷ 2 = 180
180 ÷ 2 = 90
 90 ÷ 2 = 45
 45 ÷ 3 = 15
 15 ÷ 3 = 5
  5 ÷ 5 = 1

So 360 = 2 × 2 × 2 × 3 × 3 × 5.

Work with 2 until it no longer divides, then try 3, then 5, 7, and so on. Stop when you reach 1.

Index form

Repeated factors are written with indices (powers): 2 × 2 × 2 = 2³. So

Text
360 = 2³ × 3² × 5

This short form is called index form or exponent form. You will study indices in Powers and Index Laws.

Python Factorize by repeated division

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The last line compares our result with SymPy's factorint; both give the same primes and powers.

What factorization tells you

Count the factors. Add 1 to each exponent and multiply. For 360 = 2³ × 3² × 5¹, the number of factors is (3+1)(2+1)(1+1) = 24. Reason: each factor picks a power of 2 from 0 to 3 (4 choices), a power of 3 from 0 to 2 (3 choices) and a power of 5 from 0 to 1 (2 choices).

Spot perfect squares. A number is a perfect square exactly when every exponent is even. 144 = 2⁴ × 3² is a square (it equals 12²); 360 is not, because the exponents 3 and 1 are odd. Perfect cubes need exponents divisible by 3.

Test divisibility. a divides b exactly when every prime power in a appears in b with at least the same exponent. Since 12 = 2² × 3 and 360 = 2³ × 3² × 5, 12 divides 360.

Simplify fractions. 84/126: 84 = 2² × 3 × 7 and 126 = 2 × 3² × 7. Cancel the common primes 2 × 3 × 7 = 42, leaving 2/3.

Python Count factors and test for squares

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The final line counts the divisors directly with sympy.divisors to confirm the formula gives 24 for 360.

If you find no prime divisor up to √n while factorizing, the number left over is itself prime. The code above handles this with the final if n > 1 step.

Common mistakes

  • Stopping too early: 60 = 6 × 10 is not a prime factorization, because 6 and 10 are composite.
  • Treating 1 as a prime: never include 1 in a prime factorization.
  • Forgetting repeated factors: 12 = 2² × 3, not 2 × 3.

Check your understanding

Quick check · 4 questions

of 4 answered You scored / 4 · perfect!

  1. 1. What is 84 written as a product of primes in index form?

    84 = 2 × 2 × 3 × 7 = 2² × 3 × 7. The other options contain composite numbers.
  2. 2. How many factors does 2³ × 5² have?

    (3 + 1)(2 + 1) = 4 × 3 = 12 factors.
  3. 3. Which number is a perfect square?

    Every exponent must be even. Only 2⁴ × 3² × 5² qualifies; it equals (2² × 3 × 5)² = 60² = 3600.
  4. 4. Which prime factorization is correct for 90?

    90 = 2 × 45 = 2 × 3 × 15 = 2 × 3 × 3 × 5 = 2 × 3² × 5.

Summary

  • Every whole number above 1 is a product of primes in exactly one way (ignoring order).
  • Use a factor tree or repeated division by the smallest prime.
  • Write repeated primes in index form: 360 = 2³ × 3² × 5.
  • Number of factors: add 1 to each exponent and multiply.
  • A square has all even exponents.

Next: HCF and LCM