ExamSaathi learning library · Government exams · SSC CGL quantitative foundations; published syllabus labelled 2024 · Quantitative aptitude

Counting factors: the number of factors and their sum

Count the factors of a number from its prime factorisation by adding 1 to each exponent and multiplying, find their sum with one bracket per prime, and see why perfect squares have an odd number of factors.

Status: original pilot lesson. Teacher review is pending. It is not a complete course or official exam material.

You will learn to

Before you start

A factor, or divisor, of a whole number n divides n with no remainder. Factors come in pairs whose product is n: for 45 the pairs are 1 x 45, 3 x 15 and 5 x 9, so 45 has six factors. Listing pairs is fine for small numbers but slow for a number such as 5,040. The quicker route starts from the prime factorisation, written with powers, such as 5,040 = 2^4 x 3^2 x 5 x 7. The rules below are for whole numbers greater than 1; the number 1 has just one factor, itself.

The number of factors

A factor of n can use only the primes of n, each no more times than n does. Take 200 = 2^3 x 5^2. A factor may contain 2^0, 2^1, 2^2 or 2^3, which is four choices, and 5^0, 5^1 or 5^2, which is three choices. Each pair of choices gives a different factor, so 200 has 4 x 3 = 12 factors. In general, if n = p^a x q^b x r^c for different primes p, q and r, then n has (a + 1) x (b + 1) x (c + 1) factors, with one bracket for each prime. The extra 1 in each bracket is the choice of leaving that prime out. A prime has 1 + 1 = 2 factors, as it should.

The sum of the factors

The same choices give the total of the factors. Expand (1 + 2 + 4 + 8) x (1 + 5 + 25): every term of the expansion is one factor of 200, and each factor appears once, so the 12 factors add up to 15 x 31 = 465. In general, the factors of p^a x q^b add up to (1 + p + p^2 + ... + p^a) x (1 + q + q^2 + ... + q^b), and each further prime adds another bracket. This total includes 1 and n. For the sum of the factors other than n itself, subtract n: 465 - 200 = 265.

Perfect squares, odd factors and even factors

Each factor d of n pairs with n / d. The two members of a pair are different unless d x d = n, which can only happen when n is a perfect square, so a perfect square has an odd number of factors and every other number has an even number. The counting rule agrees, because every exponent of a perfect square is even, which makes every bracket odd: 144 = 2^4 x 3^2 has 5 x 3 = 15 factors. To count the odd factors, leave out the power of 2: 360 = 2^3 x 3^2 x 5 has 4 x 3 x 2 = 24 factors, of which 3 x 2 = 6 are odd and the other 18 are even.

Common mistakes

Multiplying the exponents themselves: 2^3 x 5^2 has 4 x 3 = 12 factors, not 3 x 2 = 6. Adding the brackets instead of multiplying them. Using a base that is not prime, as in writing 100 = 4 x 25 and counting (1 + 1) x (1 + 1) = 4 factors; the rule needs 100 = 2^2 x 5^2, which has 3 x 3 = 9. Leaving the same prime in two places, such as 2^2 x 2^3, which must be joined into 2^5 first. In the sum, starting a bracket at p instead of 1, which loses every factor that leaves p out. Forgetting that 1 is odd, so it counts among the odd factors.

A factor-counting checklist

1. Break the number into primes and write it as p^a x q^b x ..., joining repeated primes into one power. 2. For the count, add 1 to every exponent and multiply the results. 3. For the sum, write one bracket 1 + p + ... + p^a for each prime and multiply the bracket totals. 4. For odd factors, drop the power of 2 before counting; the even factors are the rest. 5. An odd count goes with a perfect square and an even count with any other number, so compare the two as a check. For a small number, list the factor pairs once to confirm the answer.

Worked examples

  1. How many factors does 540 have?

    1. Divide by primes: 540 = 2 x 270 = 2 x 2 x 135, and 135 = 3 x 3 x 3 x 5.
    2. So 540 = 2^2 x 3^3 x 5^1.
    3. Add 1 to each exponent and multiply: (2 + 1) x (3 + 1) x (1 + 1) = 3 x 4 x 2 = 24.

    Answer: 540 has 24 factors.

  2. Find the sum of all the factors of 150.

    1. 150 = 2 x 3 x 5^2.
    2. Sum = (1 + 2) x (1 + 3) x (1 + 5 + 25) = 3 x 4 x 31 = 372.
    3. Check by listing the 2 x 2 x 3 = 12 factors: 1, 2, 3, 5, 6, 10, 15, 25, 30, 50, 75 and 150, which add up to 372.

    Answer: The factors of 150 add up to 372.

  3. How many of the factors of 2,160 are even?

    1. 2,160 = 2^4 x 3^3 x 5, so it has (4 + 1) x (3 + 1) x (1 + 1) = 40 factors.
    2. An odd factor uses no 2, so the odd factors are the factors of 3^3 x 5, and there are (3 + 1) x (1 + 1) = 8 of them.
    3. Even factors = 40 - 8 = 32.
    4. Direct check: an even factor uses 2^1, 2^2, 2^3 or 2^4, so there are 4 x 4 x 2 = 32 of them.

    Answer: 32 of the factors of 2,160 are even.

Practice checks

  1. How many factors does 1,000 have?
  2. The sum of all the factors of 98 is:
  3. How many whole numbers from 1 to 200 have an odd number of factors?
  4. How many odd factors does 1,440 have?
  5. The number 2^k x 3^2 x 7 has 36 factors. The value of k is:

Sources checked