NDA Maths · Binomial Theorem

Remainders & Divisibility via Binomial Expansion

Writing a base as (multiple ± 1) and expanding by the binomial theorem makes a remainder fall out — every term except the last is divisible by the modulus, so only the tail survives.

Why this matters

Only 3 PYQs, but they are quick marks once you see the move: re-express the base near a multiple of the divisor. The same idea also handles the power of a prime hidden inside a factorial.

Concept 1 of 2

Remainders by the Binomial Trick

Intuition

To find a remainder of a big power, rewrite the base as a multiple of the divisor plus or minus a small number, then expand. Every term that carries the 'multiple' factor is divisible by the divisor and vanishes mod m — only the small leftover terms decide the remainder.

Definition

To find AnmodmA^n \bmod m: write A=km±1A = km \pm 1 (or km±ckm \pm c for a small cc) and expand (km±1)n=r(nr)(km)r(±1)nr(km \pm 1)^n = \sum_r \binom{n}{r}(km)^r(\pm 1)^{n-r}. Every term with r1r \ge 1 has a factor mm, so

An(±1)n(modm).A^n \equiv (\pm 1)^n \pmod{m}.
More generally, keep only the terms NOT divisible by mm. Pairing this with a small subtraction (e.g. 7n6n17^n - 6n - 1) shows divisibility because the surviving low-order terms cancel.

Base near a multiple of m

(km±1)n(±1)n(modm)(km \pm 1)^n \equiv (\pm 1)^n \pmod{m}

Worked example

Find the remainder when 21202^{120} is divided by 7.
  1. 2120=(23)40=840=(7+1)402^{120} = (2^3)^{40} = 8^{40} = (7+1)^{40}.
  2. (7+1)40=r(40r)7r(7+1)^{40} = \sum_r \binom{40}{r} 7^r; every term with r1r \ge 1 is divisible by 7.
  3. Only the r=0r = 0 term survives mod 7: (400)1=1\binom{40}{0}\cdot 1 = 1.
Answer:Remainder =1= 1.

From the bank · past-year question

Example 1Binomial TheoremMODERATE
What is the remainder when 7n6n7^n-6n is divided by 36 for n=100n=100?

[Q36 · Sep · 2024]

Choose the base CLOSEST to a multiple of the divisor

Rewrite the base as the divisor (or a power of it) ±1\pm 1. 8=7+18 = 7+1 for mod 7; 7=6+17 = 6+1 for mod 6/36. Picking a far-off form leaves many surviving terms and defeats the trick.

Concept 2 of 2

Power of a Prime in n! (Legendre's Formula)

Intuition

To find the largest power of a prime dividing n!, count how many of 1…n are multiples of the prime, then multiples of its square, its cube, and so on — each layer contributes one extra factor. For a composite divisor, find the prime's exponent first and then divide.

Definition

The exponent of a prime pp in n!n! is Legendre's formula

Ep(n!)=np+np2+np3+E_p(n!) = \left\lfloor \dfrac{n}{p} \right\rfloor + \left\lfloor \dfrac{n}{p^2} \right\rfloor + \left\lfloor \dfrac{n}{p^3} \right\rfloor + \cdots
(the sum is finite — stop when pk>np^k > n). For a composite divisor like 8=238 = 2^3: find the power of 22 in n!n!, then the highest kk with 8kn!8^k \mid n! is E2(n!)/3\left\lfloor E_2(n!)/3 \right\rfloor.

Legendre's formula

Ep(n!)=i1npiE_p(n!) = \sum_{i\ge 1} \left\lfloor \dfrac{n}{p^{\,i}} \right\rfloor

Worked example

If 26!=n8k26! = n \cdot 8^k with n,kn, k positive integers, find the maximum kk.
  1. Power of 2 in 26!26!: 26/2+26/4+26/8+26/16=13+6+3+1=23\lfloor 26/2 \rfloor + \lfloor 26/4 \rfloor + \lfloor 26/8 \rfloor + \lfloor 26/16 \rfloor = 13 + 6 + 3 + 1 = 23.
  2. Since 8=238 = 2^3, the max kk is 23/3\lfloor 23/3 \rfloor.
Answer:k=7k = 7.

From the bank · past-year question

Example 2Binomial TheoremMODERATE
If 26!=n8k26!=n\cdot 8^k, where kk and nn are positive integers, then what is the maximum value of kk?

[Q10 · Apr · 2024]

Count the prime, then divide by its exponent

For 8=238 = 2^3, don't count "multiples of 8". Count the total power of 2 (via Legendre), then take the floor of that over 3. Counting 8s directly undercounts badly.

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 (2)

Watch out for (2)

Mastery check — 1 interleaved questions

Try each one before clicking. Questions are interleaved across the concepts above, not grouped — interleaving sharpens transfer.

Example 1Binomial TheoremEASY
What is the remainder when 21202^{120} is divided by 7?

[Q18 · Apr · 2024]

Drill every past-year question on this subtopic

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