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
- 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.
- Counting 1 as a prime. 1 is neither prime nor composite. The smallest prime is 2.
- 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.
- 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.
- How many factors does 72 have?
- What is the sum of all the factors of 28?
- How many zeros are at the end of โ60!โ?
- โpโ and โqโ are prime numbers and โp + q = 45โ. Find โpqโ.
- 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
- โ72 = 2^3 \times 3^2โ, so there are โ4 \times 3 = 12โ factors.
- โ28 = 2^2 \times 7โ, so the sum is โ(1 + 2 + 4)(1 + 7) = 7 \times 8 = 56โ.
- Count the 5s: โ12 + 2 = 14โ zeros.
- The sum is odd, so one prime is 2 and the other is 43. โpq = 86โ.
- โ77 = 7 \times 11โ. The largest prime is 11, so โn = 11โ.
Next chapter: Divisibility tests, division algorithm, remainders and unit digits.