WishWasTraining Academy
CDS exam school
โ† home
Chapter A1-3 ยท 3 of 6 in Numbers ยท 17 min read

Primes, factors and multiples; number of factors

15 real CDS questions of this kind in the 6 papers from CDS I 2024 to CDS II 2026.

Try three questions free โ†“
This chapter has a video lessonWatch it, practise with a drill and keep your record, all with a free account. No fee, no card.

Why this chapter matters. This chapter gave 15 questions in the 6 papers from CDS I 2024 to CDS II 2026. Six of them came in one paper, CDS II 2024. Seven of the 15 are about prime numbers themselves, and most of those turn on one fact: 2 is the only even prime. Three ask for the number of factors or the sum of the factors of a number. Two ask how many times a number divides a factorial. Two write a number as a difference of two squares. Three of the 15 came in the "is the statement enough" form. Every one of them begins the same way: break the number into primes.

What you will be able to do

  • Test whether a number is prime, and use the fact that 2 is the only even prime.
  • Write a number as a product of primes, and from that find how many factors it has and what they add up to.
  • Find the power of a prime in โ€‹n!โ€‹, and so the number of zeros at the end of โ€‹n!โ€‹.
  • Count the ways of writing a number as a difference of two squares.

Before you start you should know: the families of numbers and the even and odd rules (Chapter A1-1), and the laws of powers โ€‹a^m \times a^n = a^{m+n}โ€‹ and โ€‹(a^m)^n = a^{mn}โ€‹.

1. Prime and composite numbers

A factor (or divisor) of a number divides it exactly. The factors of 12 are 1, 2, 3, 4, 6 and 12. A multiple of 12 is 12 times a natural number: 12, 24, 36, ...

A prime number is a natural number with exactly two factors, 1 and itself. A composite number has more than two. The number 1 is neither prime nor composite.

There are 25 primes below 100:

2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97.

Four numbers below 100 look prime and are not: โ€‹51 = 3 \times 17โ€‹, โ€‹57 = 3 \times 19โ€‹, โ€‹87 = 3 \times 29โ€‹ and โ€‹91 = 7 \times 13โ€‹.

Test for a prime. To test โ€‹nโ€‹, divide by the primes whose square is not more than โ€‹nโ€‹. If none divides it, โ€‹nโ€‹ is prime. You can stop there, because a composite number always has a factor, other than 1, that is not more than its square root.

Is 199 prime? โ€‹14^2 = 196โ€‹ and โ€‹15^2 = 225โ€‹, so test the primes up to 14: 2, 3, 5, 7, 11, 13. None divides 199. So 199 is prime.

2. The only even prime

Every even number greater than 2 has 2 as a factor, so it is not prime. 2 is the only even prime. With the even and odd rules of Chapter A1-1 this gives three facts the paper uses.

  • If the sum of two primes is odd, one of them is 2. (Odd โ€‹+โ€‹ odd would be even.)
  • If the difference of two primes is odd, one of them is 2.
  • If the product of two primes is even, one of them is 2.

One more fact: of the three numbers โ€‹nโ€‹, โ€‹n + 2โ€‹, โ€‹n + 4โ€‹, one is always a multiple of 3. So the only three primes spaced 2 apart are 3, 5, 7.

A statement that says "always" about primes must be tested with 2. A statement that holds for all odd primes often fails for 2.

3. Prime factorisation and co-prime numbers

Every composite number can be written as a product of primes in only one way, apart from the order. Divide by 2 as long as you can, then by 3, then by 5, and so on:

360 = 2 \times 2 \times 2 \times 3 \times 3 \times 5 = 2^3 \times 3^2 \times 5

A number divides another exactly when its prime powers "fit inside". So โ€‹2^2 \times 3 = 12โ€‹ divides 360, but โ€‹2^4 = 16โ€‹ does not, because 360 has only three 2s.

Two numbers are co-prime (or relatively prime) when they have no common factor other than 1. They need not be prime themselves: 8 and 15 are co-prime. Two numbers next to each other are always co-prime, because a common factor of โ€‹nโ€‹ and โ€‹n + 1โ€‹ would have to divide their difference, which is 1.

4. The number of factors and their sum

Let โ€‹N = p^a \times q^b \times r^cโ€‹, where โ€‹pโ€‹, โ€‹qโ€‹, โ€‹rโ€‹ are different primes.

What Formula For โ€‹72 = 2^3 \times 3^2โ€‹
Number of factors โ€‹(a + 1)(b + 1)(c + 1)โ€‹ โ€‹4 \times 3 = 12โ€‹
Sum of the factors โ€‹(1 + p + \dots + p^a)(1 + q + \dots + q^b)(1 + r + \dots + r^c)โ€‹ โ€‹(1 + 2 + 4 + 8)(1 + 3 + 9) = 15 \times 13 = 195โ€‹
Factors of โ€‹N^2โ€‹ โ€‹N^2 = p^{2a} q^{2b} r^{2c}โ€‹, so the count is โ€‹(2a + 1)(2b + 1)(2c + 1)โ€‹ โ€‹7 \times 5 = 35โ€‹

Why. A factor of 72 is โ€‹2^x \times 3^yโ€‹ with โ€‹xโ€‹ chosen from 0, 1, 2, 3 (four choices) and โ€‹yโ€‹ from 0, 1, 2 (three choices). That gives โ€‹4 \times 3 = 12โ€‹ factors. The count includes 1 and the number itself.

Two things follow.

  • A perfect square has an odd number of factors, and no other number has. (In a square every power is even, so every bracket โ€‹2a + 1โ€‹ is odd.) For example 36 has 9 factors.
  • For a single prime power, the sum of the factors is short: โ€‹1 + 2 + 4 + \dots + 2^a = 2^{a+1} - 1โ€‹.

To count only the odd factors, leave out the power of 2. To count the even factors, subtract the odd ones from the total.

5. Factor pairs and the difference of two squares

Since โ€‹m^2 - n^2 = (m - n)(m + n)โ€‹, writing a number as a difference of two squares is the same as writing it as a product of two factors. But the two brackets differ by โ€‹2nโ€‹, an even number. So both brackets are even, or both are odd.

To count the ways of writing โ€‹Nโ€‹ as โ€‹m^2 - n^2โ€‹ with natural numbers โ€‹m > nโ€‹: list the factor pairs of โ€‹Nโ€‹ with two different factors, and keep the pairs in which both are odd or both are even. For each such pair, โ€‹mโ€‹ is half the sum and โ€‹nโ€‹ is half the difference.

For 15: the pairs are โ€‹1 \times 15โ€‹ and โ€‹3 \times 5โ€‹, both with two odd factors. So โ€‹15 = 8^2 - 7^2 = 4^2 - 1^2โ€‹.

A prime number greater than 2 has only one pair, โ€‹1 \times pโ€‹. So it can be written as a difference of two squares in exactly one way.

6. Primes inside a factorial

โ€‹n!โ€‹ means โ€‹1 \times 2 \times 3 \times \dots \times nโ€‹. So โ€‹5! = 120โ€‹.

The power of a prime โ€‹pโ€‹ in โ€‹n!โ€‹. Count the multiples of โ€‹pโ€‹ up to โ€‹nโ€‹, then of โ€‹p^2โ€‹, then of โ€‹p^3โ€‹, and add:

\left\lfloor \frac{n}{p} \right\rfloor + \left\lfloor \frac{n}{p^2} \right\rfloor + \left\lfloor \frac{n}{p^3} \right\rfloor + \dots

The sign โ€‹\lfloor\ \rfloorโ€‹ means "divide and drop the fraction part". The power of 2 in โ€‹10!โ€‹ is โ€‹5 + 2 + 1 = 8โ€‹.

  • Zeros at the end of โ€‹n!โ€‹. Each zero needs one 2 and one 5. The 5s are fewer, so count the 5s. For โ€‹100!โ€‹: โ€‹20 + 4 = 24โ€‹ zeros.
  • A divisor that is not prime. Break it into primes first, count each prime, then see how many copies you can make. This is done in Example 3.
  • The first factorial divisible by a prime โ€‹pโ€‹ is โ€‹p!โ€‹. A smaller factorial is a product of numbers below โ€‹pโ€‹, and none of them has the factor โ€‹pโ€‹.

Worked examples

Example 1. Is 221 prime?

โ€‹14^2 = 196โ€‹ and โ€‹15^2 = 225โ€‹, so test the primes up to 14. It is odd; its digits add to 5, so 3 does not divide it; it does not end in 0 or 5; โ€‹221 = 7 \times 31 + 4โ€‹; โ€‹221 = 11 \times 20 + 1โ€‹; and โ€‹221 = 13 \times 17โ€‹. It is not prime.

Example 2. How many factors does 360 have? How many of them are even? What is the sum of all the factors?

โ€‹360 = 2^3 \times 3^2 \times 5โ€‹. The number of factors is โ€‹4 \times 3 \times 2 = 24โ€‹. The odd factors are the factors of โ€‹3^2 \times 5โ€‹: there are โ€‹3 \times 2 = 6โ€‹. So โ€‹24 - 6 = 18โ€‹ factors are even. The sum is โ€‹(1 + 2 + 4 + 8)(1 + 3 + 9)(1 + 5) = 15 \times 13 \times 6 = 1170โ€‹.

Example 3. What is the highest power of 12 that divides โ€‹30!โ€‹?

โ€‹12 = 2^2 \times 3โ€‹. The power of 2 in โ€‹30!โ€‹ is โ€‹15 + 7 + 3 + 1 = 26โ€‹, which makes 13 copies of โ€‹2^2โ€‹. The power of 3 is โ€‹10 + 3 + 1 = 14โ€‹. Each 12 needs one โ€‹2^2โ€‹ and one 3, so the smaller count decides: โ€‹12^{13}โ€‹.

Example 4. In how many ways can 96 be written as โ€‹m^2 - n^2โ€‹, where โ€‹mโ€‹ and โ€‹nโ€‹ are natural numbers?

The factor pairs of 96 are โ€‹1 \times 96โ€‹, โ€‹2 \times 48โ€‹, โ€‹3 \times 32โ€‹, โ€‹4 \times 24โ€‹, โ€‹6 \times 16โ€‹ and โ€‹8 \times 12โ€‹. Both factors are even in four of them: โ€‹2 \times 48โ€‹, โ€‹4 \times 24โ€‹, โ€‹6 \times 16โ€‹, โ€‹8 \times 12โ€‹. So there are 4 ways. The first is โ€‹m = 25โ€‹, โ€‹n = 23โ€‹; the last is โ€‹m = 10โ€‹, โ€‹n = 2โ€‹.

Example 5. The sum of two prime numbers is 99. What is their product?

The sum is odd, so one prime is 2. The other is 97, which is prime. The product is โ€‹2 \times 97 = 194โ€‹.

From the real papers

The first five questions are from CDS I 2024, CDS I 2025 and CDS II 2025 (Series A), and the answers agree with the final official key. The sixth is from CDS I 2026, where the official key is still provisional; our answer agrees with it. Try each for 72 seconds before reading the solution.

CDS I 2025, Q48. What is the number of factors of โ€‹24^3 - 16^3 - 8^3โ€‹?

(a) 33โ€ƒโ€ƒ(b) 30โ€ƒโ€ƒ(c) 28โ€ƒโ€ƒ(d) 24

Solution. Take out the common factor โ€‹8^3โ€‹: the number is โ€‹8^3(3^3 - 2^3 - 1^3) = 512 \times (27 - 8 - 1) = 512 \times 18โ€‹. In primes, โ€‹512 = 2^9โ€‹ and โ€‹18 = 2 \times 3^2โ€‹, so the number is โ€‹2^{10} \times 3^2โ€‹. The number of factors is โ€‹11 \times 3 = 33โ€‹. Answer (a).

CDS I 2025, Q37. Given that โ€‹\frac{100 \times 99 \times 98 \times ... \times 3 \times 2 \times 1}{100^n}โ€‹ is an integer. What is the largest value of n for which this is true?

(a) 20โ€ƒโ€ƒ(b) 21โ€ƒโ€ƒ(c) 24โ€ƒโ€ƒ(d) None of the above

Solution. The top is โ€‹100!โ€‹, and โ€‹100 = 2^2 \times 5^2โ€‹. The power of 5 in โ€‹100!โ€‹ is โ€‹20 + 4 = 24โ€‹. The 2s are many more (97), so the 5s decide. Each 100 uses two 5s, so โ€‹nโ€‹ is at most โ€‹24 \div 2 = 12โ€‹. The number 24 in option (c) is the power of 10, not of 100. Since 12 is not listed, Answer (d).

CDS I 2024, Q25. What is the smallest natural number โ€‹nโ€‹ such that โ€‹(n + 1) \times n \times (n - 1) \times (n - 2) \times ... 3 \times 2 \times 1โ€‹ is divisible by 910?

(a) 91โ€ƒโ€ƒ(b) 90โ€ƒโ€ƒ(c) 13โ€ƒโ€ƒ(d) 12

Solution. The product is โ€‹(n + 1)!โ€‹, and โ€‹910 = 2 \times 5 \times 7 \times 13โ€‹. The largest prime is 13, and the first factorial divisible by 13 is โ€‹13!โ€‹ (section 6). It already contains 2, 5 and 7. So โ€‹n + 1 = 13โ€‹ and โ€‹n = 12โ€‹. The trap is option (c): the question asks for โ€‹nโ€‹, not for โ€‹n + 1โ€‹. Answer (d).

CDS II 2025, Q4. Let โ€‹xโ€‹ and โ€‹yโ€‹ be natural numbers, each less than 20, such that โ€‹xโ€‹, โ€‹yโ€‹, โ€‹x+yโ€‹ and โ€‹x-yโ€‹ are prime numbers. How many such combinations of โ€‹(x, y, x+y, x-y)โ€‹ are possible?

(a) Oneโ€ƒโ€ƒ(b) Twoโ€ƒโ€ƒ(c) Threeโ€ƒโ€ƒ(d) None

Solution. If โ€‹xโ€‹ and โ€‹yโ€‹ were both odd, โ€‹x + yโ€‹ would be an even number greater than 2, which is not prime. So one of them is 2. It cannot be โ€‹xโ€‹, because then โ€‹x - yโ€‹ would not be positive. So โ€‹y = 2โ€‹, and โ€‹x - 2โ€‹, โ€‹xโ€‹, โ€‹x + 2โ€‹ are three primes spaced 2 apart. The only such primes are 3, 5, 7 (section 2). So โ€‹x = 5โ€‹, and the combination is โ€‹(5, 2, 7, 3)โ€‹. There is one. Answer (a).

CDS II 2025, Q20. Let โ€‹pโ€‹ and โ€‹qโ€‹ be two natural numbers such that โ€‹(p+q)^{p+q}โ€‹ is divisible by 512. What is the least value of โ€‹(p+q)โ€‹?

(a) 4โ€ƒโ€ƒ(b) 6โ€ƒโ€ƒ(c) 8โ€ƒโ€ƒ(d) 12

Solution. Write โ€‹n = p + qโ€‹. Since โ€‹512 = 2^9โ€‹, the number โ€‹n^nโ€‹ must contain at least nine 2s, so โ€‹nโ€‹ is even. Test the even numbers in order. โ€‹2^2โ€‹ has two 2s. โ€‹4^4 = 2^8โ€‹ has eight, one short. โ€‹6^6 = 2^6 \times 3^6โ€‹ has six. โ€‹8^8 = 2^{24}โ€‹ has more than enough. The least value is 8. Answer (c).

CDS I 2026, Q28. Consider the following statements: I. Two consecutive natural numbers are always co-prime. II. If m and n are relatively prime, then โ€‹m \times nโ€‹ is always even. Which of the statements given above is/are correct?

(a) I onlyโ€ƒโ€ƒ(b) II onlyโ€ƒโ€ƒ(c) Both I and IIโ€ƒโ€ƒ(d) Neither I nor II

Solution. I is correct: a common factor of โ€‹nโ€‹ and โ€‹n + 1โ€‹ must divide their difference, which is 1 (section 3). II is not correct: 3 and 5 are relatively prime and โ€‹3 \times 5 = 15โ€‹ is odd. Answer (a).

A question from CDS II 2024 (no official key was published; the answer is our own working)

CDS II 2024, Q96. The number 199 can be written as โ€‹m^2 - n^2โ€‹, where โ€‹mโ€‹, โ€‹nโ€‹ are natural numbers โ€‹(m > n)โ€‹. What is the value of โ€‹mnโ€‹?

(a) 9900โ€ƒโ€ƒ(b) 9800โ€ƒโ€ƒ(c) 9701โ€ƒโ€ƒ(d) Cannot be uniquely determined

Solution. โ€‹(m - n)(m + n) = 199โ€‹, and 199 is prime (section 1). So the only pair is โ€‹1 \times 199โ€‹: โ€‹m - n = 1โ€‹ and โ€‹m + n = 199โ€‹. Then โ€‹m = 100โ€‹, โ€‹n = 99โ€‹ and โ€‹mn = 9900โ€‹. The value is fixed, so option (d) is not right. Answer (a).

Five of the seven were settled by breaking a number into primes, or by seeing that it is prime.

Mistakes that cost marks

  1. Forgetting the prime 2 in a statement with "always". "The product of two co-prime numbers is always even" and "the sum of two primes is always even" both fail. Test every such statement with 2 and with two odd numbers.
  2. Counting 1 as a prime. 1 is neither prime nor composite. The smallest prime is 2.
  3. Using the factorial rule on a number that is not prime. For the power of 100 in โ€‹100!โ€‹, count the 5s (24) and then divide by 2. The answer is 12, not 24.
  4. Forgetting to add 1 to each power. โ€‹2^{10} \times 3^2โ€‹ has โ€‹11 \times 3 = 33โ€‹ factors, not โ€‹10 \times 2 = 20โ€‹.

Quick check

Do these without help. Answers are at the end.

  1. How many factors does 72 have?
  2. What is the sum of all the factors of 28?
  3. How many zeros are at the end of โ€‹60!โ€‹?
  4. โ€‹pโ€‹ and โ€‹qโ€‹ are prime numbers and โ€‹p + q = 45โ€‹. Find โ€‹pqโ€‹.
  5. What is the smallest natural number โ€‹nโ€‹ for which โ€‹n!โ€‹ is divisible by 77?

Read and watch more, free

The NCERT books teach primes, co-primes and prime factorisation. They do not give the formulas for the number of factors or for primes in a factorial; for those, this lesson and the past papers are the material.

What Where Language
Textbook, primes, co-primes and prime factorisation NCERT Class 6 Ganita Prakash, Chapter 5 Prime Time ยท Hindi edition English, Hindi
Textbook, every number is a product of primes in one way NCERT Class 10 Mathematics, Chapter 1 Real Numbers, section 1.2 ยท Hindi edition English, Hindi
Practice with answers NCERT Exemplar Class 10, Unit 1 Real Numbers ยท Hindi edition English, Hindi
Practice with answers, easier NCERT Exemplar Class 6, Unit 1 Number System ยท Hindi edition English, Hindi
The real papers UPSC previous question papers English, Hindi
Video, a full CDS course R.S SIR: Maths Playlist for CDS 2025 (the number system lessons, about 55 minutes each) Hindi and Hinglish
Video, numbered classes Chandigarh Career Group: CDS advance maths by Sandeep Brar (the ten number system classes) Hinglish
Video, in Hindi Rojgar with Ankit Defence: CDS 01 2025, Maths By Neeraj Baisla Sir (the number system lessons) Hindi

The videos were chosen from their titles, length and views; they have not yet been watched by a teacher.

Answers to the quick check

  1. โ€‹72 = 2^3 \times 3^2โ€‹, so there are โ€‹4 \times 3 = 12โ€‹ factors.
  2. โ€‹28 = 2^2 \times 7โ€‹, so the sum is โ€‹(1 + 2 + 4)(1 + 7) = 7 \times 8 = 56โ€‹.
  3. Count the 5s: โ€‹12 + 2 = 14โ€‹ zeros.
  4. The sum is odd, so one prime is 2 and the other is 43. โ€‹pq = 86โ€‹.
  5. โ€‹77 = 7 \times 11โ€‹. The largest prime is 11, so โ€‹n = 11โ€‹.

Next chapter: Divisibility tests, division algorithm, remainders and unit digits.

Free ยท no sign-up

Try three questions on this chapter

Exam-pattern questions from this chapter's drill. Pick an answer for each, then check.

  1. Question 1 of 3
    How many even factors does 1080 have?
  2. Question 2 of 3
    Let โ€‹Nโ€‹ be a natural number.
    Question: Is โ€‹Nโ€‹ a perfect square?
    Statement-I: โ€‹Nโ€‹ has exactly 9 factors.
    Statement-II: โ€‹Nโ€‹ is divisible by 4.
    Which one of the following is correct in respect of the above Question and the Statements?
  3. Question 3 of 3
    Consider the following statements: I. Two different prime numbers are always co-prime. II. If two natural numbers are co-prime, then at least one of them is a prime number. Which of the statements given above is/are correct?
Free sign-up

You have read the chapter. Now make it stick.

A free account adds the video lesson, a drill of ten questions on this chapter marked like the exam, the timed mock papers, a study plan to your exam date and your own record of what you have done. No fee, no card.

Past questions quoted are from the official UPSC paper named in the text; the working is WishWas's own, checked against UPSC's answer key where one has been published. The links under โ€œRead and watch moreโ€ go to free material on other sites; nothing is copied.