Counting the factors of a number
A factor of a number is any number that divides it exactly. For 12 you can list them: 1, 2, 3, 4, 6 and 12. For 360 you cannot, not in 90 seconds. You count them from the prime factorisation: the number written as prime powers, such as 72 = 2³ × 3².
See it once in a grid
Every factor of 72 is built from the same primes as 72. From the 2s it can take 1, 2, 4 or 8: four choices. From the 3s it can take 1, 3 or 9: three choices. Put the choices in a grid and multiply.
| × | 1 | 2 | 4 | 8 |
|---|---|---|---|---|
| 1 | 1 | 2 | 4 | 8 |
| 3 | 3 | 6 | 12 | 24 |
| 9 | 9 | 18 | 36 | 72 |
Four columns, three rows: 12 factors.
The rule
Add one to each power, then multiply.
- 72 = 2³ × 3². Powers 3 and 2. (3 + 1) × (2 + 1) = 12 factors.
- 360 = 2³ × 3² × 5. Powers 3, 2 and 1. 4 × 3 × 2 = 24 factors.
Why add one? A factor may also leave a prime out. Power 3 gives four choices: use the prime zero, one, two or three times.
UPSC seldom asks "how many factors" in plain words. In 2023 it asked: 7x + 96 is divisible by x; how many values of x are possible? Since 7x is always divisible by x, 96 must be too. So x is a factor of 96 = 2⁵ × 3, and there are 6 × 2 = 12 values.
Factors come in pairs
Each factor has a partner, and the two multiply to give the number. For 72 the pairs are 1 × 72, 2 × 36, 3 × 24, 4 × 18, 6 × 12 and 8 × 9. Twelve factors make six pairs, so 72 is a product of two numbers in six ways.
Now take 36. The pairs are 1 × 36, 2 × 18, 3 × 12, 4 × 9 and 6 × 6. Here 6 is paired with itself, so it is counted once. 36 has 9 factors, an odd count.
This happens only for perfect squares. The rule shows why: in 36 = 2² × 3² every power is even, so every "power plus one" is odd. For a perfect square, the ways to write it as a product of two numbers are (factors + 1) ÷ 2.
Exactly two, three or four factors
Read the rule backwards: the count is given, and you find the number.
- Two factors: a prime.
- Three factors: 3 can only be 2 + 1, so the number is one prime with power 2: the square of a prime. 4, 9, 25, 49.
- Four factors: 4 is 3 + 1, or 2 × 2. So the number is the cube of a prime (8, 27) or the product of two different primes (6, 10, 14, 15).
A 2025 UPSC question turned on the smallest one-digit number with exactly four factors. It is 6, with factors 1, 2, 3 and 6.
Only odd factors, or only even factors
An odd factor has no 2 in it. Drop the power of 2 and count the factors of what is left.
- 72 = 2³ × 3². Odd factors come from 3² alone: 3 of them (1, 3, 9). Even factors = 12 − 3 = 9.
- 360 = 2³ × 3² × 5. Odd factors come from 3² × 5: 3 × 2 = 6. Even factors = 24 − 6 = 18.
An odd number has no even factor at all.
Summary
| You are asked for | What to do |
|---|---|
| Number of factors | Write prime powers, add one to each power, multiply |
| Ways to write as a product of two numbers | Half the number of factors; for a perfect square, (factors + 1) ÷ 2 |
| Exactly 3 factors | The square of a prime |
| Exactly 4 factors | The cube of a prime, or two different primes multiplied |
| Odd factors | Drop the power of 2, then use the rule |
| Even factors | Total minus odd |
Where students slip
- Multiplying the powers as they are. For 72 that gives 3 × 2 = 6 instead of 12. Add one first.
- Stopping at 72 = 8 × 9. Write 2³ × 3² before you count.
- Counting factors the question rules out. If a division leaves remainder 31, the divisor must be bigger than 31.
- Saying every perfect square has three factors. Only the square of a prime does.
How to practise
Take ten numbers under 200. Write each as prime powers and say the number of factors. For the small ones, list the factors and check. Then count the odd factors, the even factors and the pairs. When a question says "divides exactly" or "how many values", ask which number's factors it wants.