PYQ Vault

CDS Mathematics · Number System

Prime Numbers & Primality

What a prime is, how to test one by trial division up to the square root, why a question about primes summing to something odd almost always forces one of them to be 2, and which plausible prime-generating forms are traps.

Why this matters

Twenty-two PYQs and not one of them rated HARD — this is the most reliable unit in the chapter. Almost every question is recall or a single structural argument. The one argument to own is the parity move that pins a prime to 2: it appears in five of the twenty-two and turns a search into a one-line deduction.

Concept 1 of 6

Primes, composites, and the numbers that are neither

Intuition

A prime has exactly two positive divisors, itself and 1. Counting divisors rather than reciting a definition settles the awkward cases immediately: 1 has only one divisor so it is not prime, and it is not composite either.

Definition

A positive integer n>1n>1 is prime if its only positive divisors are 1 and nn; otherwise it is composite.

  • 11 is neither prime nor composite — it has exactly one divisor.
  • 22 is the only even prime, which is why parity arguments are so powerful here.
  • There are 25 primes below 100, and 15 below 50.
  • Two numbers are coprime (relatively prime) when their HCF is 1; neither needs to be prime.
ClaimVerdictWhy
1 is primeFalseIt has one divisor, not two
1 is compositeFalseIt is neither
2 is primeTrueDivisors 1 and 2 only
Every prime is oddFalse2 is even
This is the single most useful exception in the chapter — it is what lets you force one prime to be 2.
Number of primes below 100252, 3, 5, ..., 89, 97
Number of primes below 5015So 10 lie between 50 and 100
Possible unit digits of a prime1, 2, 3, 5, 7, 9Six digits; 0, 4, 6, 8 give an even number above 2
Smallest odd composite91 is neither; 3, 5, 7 are prime
A product of two composites can be coprimeTrue4 and 9 share no prime factor
Nine rows CDS asks about directly. The 25-below-100 count and the six possible unit digits are pure recall.
Practice this conceptself-check · 4 quick reps

From the bank · past-year question

Example 1Number SystemEASY
The number of prime numbers which are less than 100 is

[Q21 · CDS (I) 2017 — Elementary Mathematics · 2017]

Coprime does not mean prime

44 and 99 are coprime and both composite; 33 and 44 are coprime with one of each. "Relatively prime" is a statement about the pair, not about either number, so every combination of prime and composite is possible — which is exactly what the 2019 and 2016 statement questions test.

Concept 2 of 6

Testing a number for primality by trial division

Intuition

To check whether nn is prime you only need to try prime divisors up to n\sqrt{n}. If n=abn=ab with both factors above n\sqrt{n}, their product would exceed nn — so one factor must be at or below the square root.

Definition

To test nn: divide by each prime pp with pnp \le \sqrt{n}. If none divides nn, then nn is prime.

  • Only primes need testing, since any composite divisor carries a smaller prime one.
  • Useful square-root landmarks: 400=20\sqrt{400}=20, 900=30\sqrt{900}=30, 1600=40\sqrt{1600}=40, 2500=50\sqrt{2500}=50.

So a three-digit number needs primes only up to 31, and a number below 2500 only up to 47.

Trial-division bound

n is prime    pn  for every prime pnn \text{ is prime} \iff p \nmid n \ \text{ for every prime } p \le \sqrt{n}

Worked example

Is 391 prime?
Practice this conceptself-check · 4 quick reps

From the bank · past-year question

Example 2Number SystemMODERATE
Consider the following numbers : 1. 437 2. 797 3. 1073 How many of the above numbers are prime?

[Q7 · CDS (I) 2023 — Elementary Mathematics · 2023]

Numbers near 400 or 1000 look prime and often are not

437=19×23437 = 19\times 23 and 1073=29×371073 = 29\times 37 both survive every easy test — odd, not a multiple of 3, not ending in 5 — and fail only at a two-digit prime. Push the trial division all the way to n\sqrt{n}; stopping at 13 because "nothing small worked" is how both of those get called prime.

Concept 3 of 6

Forcing a prime to be 2 with a parity argument

Intuition

Every prime except 2 is odd. So the moment a question's arithmetic demands an even value where only odd primes are available, one of the primes has to be 2 — and that usually pins the whole problem down in a line.

Definition

The argument in its usual forms:

  • Odd total. A sum of two primes is odd only if one of them is even, i.e. equals 2.
  • Odd count. Three odd primes sum to an odd number; if the target is even, one prime is 2.
  • Even product. If a product of primes is even, one factor is 2.
  • Both sum and difference prime. If xx and yy are odd primes then x+yx+y and xyx-y are both even, and they cannot both be 2 — so one of x,yx, y is 2.

The forcing rule

p+q odd (with p,q prime)    {p,q}2p+q \text{ odd (with } p,q \text{ prime)} \;\Longrightarrow\; \{p,q\} \ni 2

Worked example

The sum of two primes is 45. Find them.
Practice this conceptself-check · 4 quick reps

From the bank · past-year question

Example 3Number SystemMODERATE
The sum of three prime numbers is 100. If one of them exceeds another by 36, then one of the numbers is

[Q14 · CDS (II) 2019 — Elementary Mathematics · 2019]

Having forced the 2, still check the survivor is prime

The parity step tells you one prime is 2; it does not tell you the rest works. For a sum of 45 you still verify 43 is prime. And when the answer options list values that never occur — as in the 2019 question whose three primes are 2, 31 and 67 while the options offer 17, 29 and 43 — "none of these" is the intended answer, not a sign you slipped.

Concept 4 of 6

Coprimality and Euclid's lemma

Intuition

Two numbers are coprime when they share no prime factor. That single idea does a lot of work: consecutive integers are always coprime, and a prime dividing a product must divide one of the factors.

Definition

aa and bb are coprime when gcd(a,b)=1\gcd(a,b)=1.

  • Consecutive integers are always coprime: any common divisor divides their difference, which is 1.
  • If pp is coprime to both qq and rr, it is coprime to qrqr — no new prime factor appears in a product.
  • Euclid's lemma: if a prime pp divides qrqr then pqp \mid q or prp \mid r. This needs pp prime: 42×64 \mid 2\times 6 but 44 divides neither.
  • If acda \mid cd and gcd(a,c)=1\gcd(a,c)=1, then ada \mid d.

Coprimality via the difference

gcd(n,n+1)=1for every integer n\gcd(n,\,n+1)=1 \quad\text{for every integer } n

Worked example

Show that nn and 2n+12n+1 are coprime for every positive integer nn.
Practice this conceptself-check · 4 quick reps

From the bank · past-year question

Example 4Number SystemMODERATE
Consider the following statements : 1. If pp is relatively prime to each of qq and rr, then pp is relatively prime to the product qrqr. 2. If pp divides the product qrqr and if pp divides qq, then pp must divide rr. Which of the above statements is/are correct ?

[Q72 · CDS (I) 2019 — Elementary Mathematics · 2019]

Euclid's lemma needs the divisor to be PRIME

"If pqrp \mid qr then pqp\mid q or prp \mid r" is false for composite pp: 44 divides 2×6=122\times 6 = 12 but divides neither 2 nor 6. CDS plants exactly this by dropping the word prime from the statement.

Concept 5 of 6

Forms that look like they generate primes but do not

Intuition

Several formulas produce long runs of primes and then fail. CDS sets these as "which statement is not true" questions, so the examinable content is the counterexample, not the pattern. Memorise the first failure of each form.

Definition

The distinction that matters is direction:

  • Every prime greater than 3 is of the form 6n±16n\pm1 — that direction is true.
  • But a number of the form 6n±16n\pm1 need not be prime. The converse fails, and confusing the two directions is the whole trap.

Twin primes are pairs differing by 2; a prime triple spaced by 2 exists only once, as 3,5,73,5,7.

Form or claimAlways prime?First failure
6n16n-1Non=6n=6 gives 35=5×735=5\times 7
6n+16n+1Non=4n=4 gives 25=5225=5^2
Every prime >3>3 is 6n±16n\pm1TrueThis is the valid direction
True one way, false the other. The question always tests the false direction.
2n12^n-1 (Mersenne)Non=11n=11 gives 2047=23×892047=23\times 89
n2+n+41n^2+n+41Non=40n=40 gives 1681=4121681=41^2
Product of first nn primes, plus 1Non=6n=6 gives 30031=59×50930031=59\times 509
It is prime for n=1n=1 to 55 — 3, 7, 31, 211, 2311 — which is why the statement looks safe.
Prime triples spaced by 2Only once3,5,73,5,7; one of any such triple is a multiple of 3
Difference of two primes >2>2Always evenBoth are odd
Learn the failure, not the pattern. Each right-hand entry is a complete answer to a statement question.
Practice this conceptself-check · 4 quick reps

From the bank · past-year question

Example 5Number SystemMODERATE
Which of the following statements is not true ?

[Q7 · CDS (II) 2019 — Elementary Mathematics · 2019]

The converse of a true statement about primes is usually false

Every prime above 3 has the form 6n±16n\pm1, so it is tempting to accept "6n16n-1 is always prime". It is not — 3535 settles it. Whenever a statement about primes reads like a generating rule, look for the first small counterexample rather than checking a few cases that work.

Concept 6 of 6

Breaking a number into its prime factors

Intuition

Divide out the small primes in order, and stop as soon as the remaining quotient is below the square of your current divisor — at that point the quotient is itself prime. Working upwards in order is what keeps this fast and complete.

Definition

Every integer above 1 factorises into primes in exactly one way (the fundamental theorem of arithmetic). Procedure: try 2,3,5,7,11,13,2, 3, 5, 7, 11, 13, \ldots in turn, dividing out each prime as many times as it goes, and stop when the remaining quotient is less than the square of the next prime — the quotient is then prime. The alternating-sum test for 11 is worth having ready here, because 11 is the first divisor that no other quick rule catches.

Unique factorisation

N=p1a1p2a2pkakuniquelyN = p_1^{a_1} p_2^{a_2}\cdots p_k^{a_k} \quad\text{uniquely}

Worked example

Find the distinct prime factors of 2431.
Practice this conceptself-check · 4 quick reps

From the bank · past-year question

Example 6Number SystemMODERATE
What are distinct prime factors of the number 26381 ?

[Q1 · CDS (II) 2021 — Elementary Mathematics · 2021]

The LCM of two distinct primes is their product

Given "the LCM of two primes is 2231", do not search: two distinct primes share no factor, so their LCM is pqpq. Factorising 2231=23×972231 = 23\times 97 answers the question immediately. If the two primes were equal the LCM would be the prime itself, so a composite LCM guarantees they are distinct.

Summary — formulas & gotchas at a glance

A revision cheat-sheet for the formulas and gotchas above. Click any concept name to jump back to its full explanation.

Formulas (4)

  • Testing a number for primality by trial division

    Trial-division bound

    n is prime    pn  for every prime pnn \text{ is prime} \iff p \nmid n \ \text{ for every prime } p \le \sqrt{n}
  • Forcing a prime to be 2 with a parity argument

    The forcing rule

    p+q odd (with p,q prime)    {p,q}2p+q \text{ odd (with } p,q \text{ prime)} \;\Longrightarrow\; \{p,q\} \ni 2
  • Coprimality and Euclid's lemma

    Coprimality via the difference

    gcd(n,n+1)=1for every integer n\gcd(n,\,n+1)=1 \quad\text{for every integer } n
  • Breaking a number into its prime factors

    Unique factorisation

    N=p1a1p2a2pkakuniquelyN = p_1^{a_1} p_2^{a_2}\cdots p_k^{a_k} \quad\text{uniquely}

Reference tables (2)

Primes, composites, and the numbers that are neither9 rows
ClaimVerdictWhy
1 is primeFalseIt has one divisor, not two
1 is compositeFalseIt is neither
2 is primeTrueDivisors 1 and 2 only
Every prime is oddFalse2 is even
This is the single most useful exception in the chapter — it is what lets you force one prime to be 2.
Number of primes below 100252, 3, 5, ..., 89, 97
Number of primes below 5015So 10 lie between 50 and 100
Possible unit digits of a prime1, 2, 3, 5, 7, 9Six digits; 0, 4, 6, 8 give an even number above 2
Smallest odd composite91 is neither; 3, 5, 7 are prime
A product of two composites can be coprimeTrue4 and 9 share no prime factor
Nine rows CDS asks about directly. The 25-below-100 count and the six possible unit digits are pure recall.
Forms that look like they generate primes but do not8 rows
Form or claimAlways prime?First failure
6n16n-1Non=6n=6 gives 35=5×735=5\times 7
6n+16n+1Non=4n=4 gives 25=5225=5^2
Every prime >3>3 is 6n±16n\pm1TrueThis is the valid direction
True one way, false the other. The question always tests the false direction.
2n12^n-1 (Mersenne)Non=11n=11 gives 2047=23×892047=23\times 89
n2+n+41n^2+n+41Non=40n=40 gives 1681=4121681=41^2
Product of first nn primes, plus 1Non=6n=6 gives 30031=59×50930031=59\times 509
It is prime for n=1n=1 to 55 — 3, 7, 31, 211, 2311 — which is why the statement looks safe.
Prime triples spaced by 2Only once3,5,73,5,7; one of any such triple is a multiple of 3
Difference of two primes >2>2Always evenBoth are odd
Learn the failure, not the pattern. Each right-hand entry is a complete answer to a statement question.

Watch out for (6)

Drill every past-year question on this subtopic

22 questions from the bank — paginated, with cart and Word-export support.

Related notes