PYQ Vault

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.

Test yourself — a quick 18-question Binomial Theorem recall quiz, instant score.

Concept 1 of 2: Remainders by the Binomial Trick

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 An mod mA^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)n−r(km \pm 1)^n = \sum_r \binom{n}{r}(km)^r(\pm 1)^{n-r}. Every term with r≥1r \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. 7n−6n−17^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.

The same idea in a real exam question:

NDA · Sep 2024 · Q36Moderate

Example 1 · Binomial Theorem · Remainders and Divisibility via Binomial Expansion

What is the remainder when 7n−6n7^n-6n is divided by 36 for n=100n=100?

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)

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 8k∣n!8^k \mid n! is ⌊E2(n!)/3⌋\left\lfloor E_2(n!)/3 \right\rfloor.

Legendre's formula

Ep(n!)=∑i≥1⌊np i⌋E_p(n!) = \sum_{i\ge 1} \left\lfloor \dfrac{n}{p^{\,i}} \right\rfloor

Worked example

If 26!=n⋅8k26! = n \cdot 8^k with n,kn, k positive integers, find the maximum kk.

The same idea in a real exam question:

NDA · Apr 2024 · Q10Moderate

Example 2 · Binomial Theorem · Remainders and Divisibility via Binomial Expansion

If 26!=n⋅8k26!=n\cdot 8^k, where kk and nn are positive integers, then what is the maximum value of kk?

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)

Test yourself on Binomial Theorem

15 past NDA questions from this chapter, timed at 19 minutes and marked the way the exam marks it. You see your score and every answer the moment you finish. Free to start.