Skip to content

Prime factorization and the fundamental theorem

5 min read

Short answer

Every integer n>1n>1 is a product of primes, and the factorization is unique apart from order: n=p1a1p2a2⋯pkakn=p_1^{a_1}p_2^{a_2}\cdots p_k^{a_k}. Exponents reveal everything: the number of divisors is (a1+1)⋯(ak+1)(a_1+1)\cdots(a_k+1).

Bar chart235360 = 2³ · 3² · 5¹: exponents 3, 2, 1.
A number is determined by its prime exponents.

Finding the factorization

Divide by the smallest prime that works, repeat, and stop when the quotient is 11. You only need to test primes up to n\sqrt n, because a composite number has a prime factor no larger than its square root.

gcd and lcm from exponents

For each prime take the smaller exponent for the gcd and the larger for the lcm. Together gcd⁡(a,b)⋅lcm⁡(a,b)=ab\gcd(a,b)\cdot\operatorname{lcm}(a,b)=ab.

Worked example

Factor 360360, count its divisors, and find gcd⁡(360,84)\gcd(360,84).

360=23⋅32⋅5360=2^3\cdot3^2\cdot5, so it has (3+1)(2+1)(1+1)=24(3+1)(2+1)(1+1)=24 divisors. Also 84=22⋅3⋅784=2^2\cdot3\cdot7. Smaller exponents: 22⋅31=122^2\cdot3^1=12. So gcd⁡(360,84)=12\gcd(360,84)=12.

Try it yourself

How many positive divisors does 7272 have?

Show the answer

72=23⋅3272=2^3\cdot3^2, so the count is (3+1)(2+1)=12(3+1)(2+1)=12.

Keep going with practice

Vidi's counting lessons use the multiplication rule, the same idea behind the divisor-count formula.