ExamShortcut
high importance~2 Q in Tier 135 formulas⚡ 18 shortcuts6 subtopics
All subtopics·Subtopic 5 of 6

Factors, prime factorisation & trailing zeros

🔒 Log in to track
⏱ 4 min read🧩 6 question types🎯 17 practice Q
The idea in one minute

Write N as a product of primes, N = p to the a times q to the b times r to the c. The number of factors is (a+1)(b+1)(c+1), the sum of factors comes from bracket products, and trailing zeros of a factorial come from counting fives.

01

Overview

A factor of a number divides it exactly. The factors of 1212 are 1,2,3,4,6,121, 2, 3, 4, 6, 12. A multiple is the reverse idea: 12,24,36,…12, 24, 36, \ldots Every question here starts from the prime factorisation, so that skill comes first.

02

Prime factorisation

Keep dividing by the smallest prime that fits. 720=2×360=2×2×180=⋯=24×32×5720 = 2 \times 360 = 2 \times 2 \times 180 = \cdots = 2^4 \times 3^2 \times 5. Write the result in power form N=pa×qb×rcN = p^a \times q^b \times r^c; every method below reads the exponents.

03

Counting factors

A factor of 24×32×52^4 \times 3^2 \times 5 chooses one power of each prime. The power of 22: 0,1,2,30, 1, 2, 3 or 44, so five choices. The power of 33: 0,10, 1 or 22, so three choices. The power of 55: 00 or 11, so two choices.

Rule: Number of factors =(a+1)(b+1)(c+1)= (a+1)(b+1)(c+1). For 720720: 5×3×2=305 \times 3 \times 2 = 30 factors.

04

Odd, even and special factors

  • Odd factors: drop the power of 22 completely. For 3600=24×32×523600 = 2^4 \times 3^2 \times 5^2: odd factors =3×3=9= 3 \times 3 = 9.
  • Even factors: total minus odd, here 45−9=3645 - 9 = 36.
  • Factors that are multiples of kk: divide NN by kk and count factors of the result. For 14401440 with k=12k = 12: 1440÷12=120=23×3×51440 \div 12 = 120 = 2^3 \times 3 \times 5, giving 1616.
  • Perfect-square factors: every exponent may take even values only. Cube factors: 0,3,6,…0, 3, 6, \ldots
05

Sum of factors

Write one bracket per prime and multiply.

sum=(1+p+⋯+pa)(1+q+⋯+qb)⋯\text{sum} = (1 + p + \cdots + p^a)(1 + q + \cdots + q^b) \cdots

For 360=23×32×5360 = 2^3 \times 3^2 \times 5: (1+2+4+8)(1+3+9)(1+5)=15×13×6=1170(1 + 2 + 4 + 8)(1 + 3 + 9)(1 + 5) = 15 \times 13 \times 6 = 1170. For the sum of even factors only, start the bracket of 22 at 22: (2+4+8)×⋯(2 + 4 + 8) \times \cdots

Tip: The bracket form also answers sum of odd factors: just delete the bracket of 22.

06

Product of factors and factor pairs

Factors pair as (1,N),(2,N/2),…(1, N), (2, N/2), \ldots and each pair multiplies to NN. So the product of all factors of NN is Nd/2N^{d/2} where dd is the factor count: for 1212, with 66 factors, the product is 123=172812^3 = 1728.

The same pairing counts the ways to write NN as a product of two factors: d/2d/2 ways when NN is not a perfect square, (d+1)/2(d+1)/2 when it is. For two co-prime factors the answer is 2k−12^{k-1}, with kk the number of distinct primes.

07

Trailing zeros of factorials

A trailing zero needs a 10=2×510 = 2 \times 5. Factorials hold more twos than fives, so count the fives: divide by 55, then the quotient by 55 again, and add.

Rule: Zeros in n!=⌊n5⌋+⌊n25⌋+⌊n125⌋+⋯n! = \left\lfloor \dfrac{n}{5} \right\rfloor + \left\lfloor \dfrac{n}{25} \right\rfloor + \left\lfloor \dfrac{n}{125} \right\rfloor + \cdots. For 125!125!: 25+5+1=3125 + 5 + 1 = 31 zeros.

08

Highest power of a prime in a factorial

Same successive division by the prime. The power of 33 in 100!100! is 33+11+3+1=4833 + 11 + 3 + 1 = 48. For a composite such as 12=22×312 = 2^2 \times 3, find each prime's power, divide the power of 22 by 22, and take the smaller result. In 50!50!: twos give 4747, so 2323 twos-pairs, and threes give 2222; the answer is 2222.

09

Question types you will see

Each type: how to recognise it, the method step by step, and one question to try.

Type 1very common2 practice Q

Number of factors: total, odd, even

How to spot it:

The question asks how many factors or divisors a number has, or how many of them are odd or even.

N=paqbrc ⇒ d(N)=(a+1)(b+1)(c+1)N = p^a q^b r^c \ \Rightarrow\ d(N) = (a + 1)(b + 1)(c + 1)
Method
  1. Prime-factorise NN.

  2. Total factors: multiply (each exponent +1+ 1).

  3. Odd factors: ignore the power of 22 entirely.

  4. Even factors: total minus odd.

Why it works:

Each factor picks one power of every prime, and the choices are independent.

Try this

How many factors does 420 have?

Show solution
  1. 420=22×3×5×7420 = 2^2 \times 3 \times 5 \times 7.

  2. Total: (2+1)(1+1)(1+1)(1+1)=3×2×2×2(2+1)(1+1)(1+1)(1+1) = 3 \times 2 \times 2 \times 2.

  3. =24= 24 factors.

Answer

24

Type 2common2 practice Q

Special factors: squares, cubes, multiples of k

How to spot it:

The question asks how many factors of N are perfect squares, perfect cubes, or divisible by a given number.

#{factors divisible by k}=d(N/k)\#\{\text{factors divisible by } k\} = d(N / k)
Method
  1. For square factors, allow only even exponents 0,2,4,…0, 2, 4, \ldots for every prime.

  2. For cube factors, allow only 0,3,6,…0, 3, 6, \ldots

  3. For multiples of kk, divide NN by kk and count factors of the quotient.

Why it works:

A square factor carries even powers only; a factor divisible by k is k times a factor of N/k.

Try this

How many factors of 2 to the power 6 x 3 to the power 4 are perfect squares?

Show solution
  1. Powers of 22 available to a square: 0,2,4,60, 2, 4, 6, that is 44 choices.

  2. Powers of 33: 0,2,40, 2, 4, that is 33 choices.

  3. 4×3=124 \times 3 = 12 square factors.

Answer

12

Type 3common2 practice Q

Sum of factors

How to spot it:

The question asks for the sum of all factors of N, or the sum of only the odd or only the even factors.

σ(N)=(1+p+⋯+pa)(1+q+⋯+qb)⋯\sigma(N) = (1 + p + \cdots + p^a)(1 + q + \cdots + q^b) \cdots
Method
  1. Prime-factorise NN.

  2. Write one bracket per prime, running from 11 to the full power.

  3. Multiply the brackets.

  4. Odd sum: delete the bracket of 22. Even sum: start that bracket at 22.

Why it works:

Expanding the bracket product produces every factor exactly once.

Try this

Find the sum of all factors of 90.

Show solution
  1. 90=2×32×590 = 2 \times 3^2 \times 5.

  2. Brackets: (1+2)(1+3+9)(1+5)(1 + 2)(1 + 3 + 9)(1 + 5).

  3. =3×13×6=234= 3 \times 13 \times 6 = 234.

Answer

234

Type 4very common2 practice Q

Trailing zeros in a factorial or product

How to spot it:

The question asks how many zeros end a factorial like 90!, or end a written-out product.

Z(n!)=⌊n5⌋+⌊n25⌋+⋯Z(n!) = \left\lfloor \dfrac{n}{5} \right\rfloor + \left\lfloor \dfrac{n}{25} \right\rfloor + \cdots
Method
  1. Divide nn by 55 and keep the whole part.

  2. Divide that quotient by 55 again, and keep going.

  3. Add all the quotients.

  4. For a plain product, count the twos and the fives and take the smaller count.

Why it works:

Each trailing zero needs one two and one five, and fives are the scarce partner.

Try this

How many zeros are at the end of 90 factorial?

Show solution
  1. 90÷5=1890 \div 5 = 18.

  2. 18÷5=318 \div 5 = 3.

  3. Zeros: 18+3=2118 + 3 = 21.

Answer

21

Type 5common2 practice Q

Highest power of a prime or composite in a factorial

How to spot it:

The question asks for the largest n such that 7 to the n divides 150!, or the highest power of 12 in 50!.

Ep(n!)=∑k≥1⌊npk⌋E_p(n!) = \sum_{k \ge 1} \left\lfloor \dfrac{n}{p^k} \right\rfloor
Method
  1. For a prime pp: divide nn by pp, then the quotient again, and add the quotients.

  2. For a composite, split into prime powers.

  3. Divide each prime's count by the power required.

  4. Take the smallest result.

Why it works:

Floor division counts multiples of p, then the extra p carried by multiples of its square, and so on.

Try this

Find the highest power of 7 that divides 150 factorial.

Show solution
  1. 150÷7=21150 \div 7 = 21.

  2. 21÷7=321 \div 7 = 3.

  3. Total: 21+3=2421 + 3 = 24.

Answer

7 to the power 24

Type 6occasional3 practice Q

Product of factors and factor pairs

How to spot it:

The question asks for the product of all factors of N, or in how many ways N can be written as a product of two factors.

∏factors=Nd/2,pairs=d2 (N not a square)\prod \text{factors} = N^{d/2}, \qquad \text{pairs} = \dfrac{d}{2} \ (N \text{ not a square})
Method
  1. Count the factors dd.

  2. Product of factors: raise NN to d/2d/2.

  3. Two-factor products: d/2d/2 ways, or (d+1)/2(d+1)/2 for a perfect square.

  4. Co-prime pairs: 2k−12^{k-1} with kk distinct primes.

Why it works:

Factors pair as f with N over f, and each pair multiplies to N.

Try this

In how many ways can 48 be written as a product of two factors?

Show solution
  1. 48=24×348 = 2^4 \times 3, so d=(4+1)(1+1)=10d = (4+1)(1+1) = 10 factors.

  2. 4848 is not a perfect square.

  3. Ways: 10÷2=510 \div 2 = 5.

Answer

5

10

Formula sheet

Number of factors
d(N)=(a+1)(b+1)(c+1)d(N) = (a + 1)(b + 1)(c + 1)
Sum of factors
σ(N)=(1+p+⋯+pa)(1+q+⋯+qb)⋯\sigma(N) = (1 + p + \cdots + p^a)(1 + q + \cdots + q^b) \cdots
Even factors
a×(b+1)(c+1)a \times (b + 1)(c + 1)

when 2 has exponent a

Product of all factors
Nd(N)/2N^{d(N)/2}
Trailing zeros in n factorial
⌊n5⌋+⌊n25⌋+⌊n125⌋+⋯\left\lfloor \dfrac{n}{5} \right\rfloor + \left\lfloor \dfrac{n}{25} \right\rfloor + \left\lfloor \dfrac{n}{125} \right\rfloor + \cdots
Highest power of a prime in n factorial
∑k≥1⌊npk⌋\sum_{k \ge 1} \left\lfloor \dfrac{n}{p^k} \right\rfloor
11

Shortcuts that save time

⚡ Even factors: force one two

If N has two to the power a in it, even factors equal a times the factor count of the odd part.

Example

How many even factors does 360 have?

Show solution
  1. 360=23×32×5360 = 2^3 \times 3^2 \times 5.

  2. Even factors =3×(2+1)×(1+1)=3×3×2= 3 \times (2 + 1) \times (1 + 1) = 3 \times 3 \times 2.

  3. =18= 18.

Answer

18

⚡ Successive division by five

For trailing zeros, keep dividing n by 5 and add the quotients until the quotient is 0.

Example

How many zeros end 1000!?

Show solution
  1. 1000→200→40→8→11000 \to 200 \to 40 \to 8 \to 1.

  2. Sum: 200+40+8+1200 + 40 + 8 + 1.

  3. 249249 zeros.

Answer

249

⚡ Sum of factors as brackets

One bracket per prime, each running from 1 up to the full power. Multiply the brackets.

Example

Find the sum of all factors of 72.

Show solution
  1. 72=23×3272 = 2^3 \times 3^2.

  2. Brackets: (1+2+4+8)(1+3+9)=15×13(1 + 2 + 4 + 8)(1 + 3 + 9) = 15 \times 13.

  3. =195= 195.

Answer

195

12

Mistakes to avoid

Where most students lose marks on this subtopic.

Mistake 01

Counting only n/5 for trailing zeros.

Add the extra fives from 25, 125 and higher powers of 5 as well.

Mistake 02

Adding exponents instead of multiplying (a+1)(b+1)(c+1).

The choices per prime multiply, they never add.

Mistake 03

Forgetting 1 and N as factors.

Both count; the formula (a+1)(b+1)(c+1) already includes them.

Mistake 04

Adding the zero counts for a sum like 100! + 200!.

The sum keeps only the smaller count of trailing zeros.

Mistake 05

Testing for a prime with squares of primes only.

Divide by every prime up to the square root of N.

13

Quick revision

Read this the night before the exam.

  • Factor count: (a+1)(b+1)(c+1)(a+1)(b+1)(c+1); odd factors: drop the 22.

  • Multiples of kk among the factors: count factors of N/kN/k.

  • Square factors: even exponents only; cube factors: 0,3,6,…0, 3, 6, \ldots

  • Sum: one bracket per prime, multiply the brackets.

  • Product of all factors: Nd/2N^{d/2}.

  • Zeros in n!n!: keep dividing nn by 55 and add quotients.

  • Composite power in n!n!: split into prime powers and take the smallest.

14

Practice: 17 questions

Sets of 10, mixed across the question types above. Every answer has a step-by-step explanation.

Topic test · 10 questions

Suggested time 8 min · wrong answers go to your mistake notebook automatically.