Euler Hall — free maths guides

Prime factorisation: divide out the smallest prime, then repeat

A plain-language explanation of prime factorisation. The idea in plain words, a worked example, and a check with the answers shown — part of the free Quantitative Reasoning guides.

The unique decomposition

Every integer above 1 can be written as a product of primes, and the primes involved are the same however you find them. That is the fundamental theorem of arithmetic, and it is what makes "the prime factorisation" a definite object.

The method is repeated division by the smallest prime that goes in:

120=2⋅60=2⋅2⋅30=22⋅15=23⋅3⋅5.120 = 2 \cdot 60 = 2 \cdot 2 \cdot 30 = 2^2 \cdot 15 = 2^3 \cdot 3 \cdot 5.

Written with exponents,120=23⋅3⋅5120 = 2^3 \cdot 3 \cdot 5. The check is to multiply back:8⋅3⋅5=1208 \cdot 3 \cdot 5 = 120.

Two things make a factorisation wrong:

- a composite factor left in.120=8⋅15120 = 8 \cdot 15 multiplies to 120 and is not a prime factorisation, because 8 and 15 are composite. - an exponent off by one.120=22⋅3⋅5120 = 2^2 \cdot 3 \cdot 5 gives 60, not 120.

The first is the commoner error, because the product is right and only the CLAIM is wrong.

Why the primes come out the same every time

The fundamental theorem of arithmetic says the multiset of primes is unique. So however you factor — smallest prime first, or by spotting a large factor — you end with the same primes and the same exponents.

That is not obvious, and it is what makes the exponent a well-defined number rather than an artefact of the method. It also underlies the gcd and lcm rules later in this module: those read the exponents off the factorisation, and they would mean nothing if the exponents could vary.

The proof's key step is Euclid's lemma: if a primepp divides a productabab, thenpp dividesaa orpp dividesbb. Without it, a number could have two genuinely different prime decompositions.

Practically, the method is trial division by primes in increasing order. It is slow for large numbers — which is precisely the fact public-key cryptography relies on.

Worked example: a factorisation with a repeated prime

Factor 360.

Step one — smallest prime first. 360 is even, so 2 goes in:360÷2=180360 \div 2 = 180.

Step two — repeat while it divides.180÷2=90180 \div 2 = 90;90÷2=4590 \div 2 = 45. Now 45 is odd, so 2 stops. Three 2s so far:23=82^3 = 8.

Step three — move to the next prime. 45's digit sum is 9, so 3 divides it:45÷3=1545 \div 3 = 15;15÷3=515 \div 3 = 5. Two 3s.

Step four — the remainder. 5 is prime, so it stops the process.

Answer.360=23⋅32⋅5360 = 2^3 \cdot 3^2 \cdot 5.

The check.8⋅9⋅5=3608 \cdot 9 \cdot 5 = 360. And every factor is prime, which is the other half of the claim.

By the end you can
  • Factor a small integer into primes
  • Check a factorisation by multiplying back AND testing that every factor is prime
  • Say why the exponent of each prime is well defined
Check yourself

1. Factor 100 into primes. 2. Factor 64. 3. Is2⋅2⋅3⋅3⋅52 \cdot 2 \cdot 3 \cdot 3 \cdot 5 a prime factorisation of 180? Answer both ways: is the product right, and is it a prime factorisation?

Answers

1.100=22⋅52100 = 2^2 \cdot 5^2. 2.64=2664 = 2^6. 3. The product is180180: right. But it is not written in the standard form — the primes should be collected as exponents,180=22⋅32⋅5180 = 2^2 \cdot 3^2 \cdot 5. It IS a product of primes, so the mathematics is right; only the presentation needs the exponents.

Work out where to start — free, no accountAnswer six real questions — free, no account