0
0

Highest Power of a Prime in n!

Introduction

Many problems in number theory and combinatorics ask: What is the largest power of a prime that divides n!? This is useful for finding trailing zeros, divisibility properties, and simplifying factorial-based expressions.

The tool used to solve such problems is Legendre’s Formula, which counts how many times a prime divides the factorial n!.

Pattern: Highest Power of a Prime in n!

Pattern

Legendre’s Formula gives the exponent of a prime p in n! as:

vₚ(n!) = ⌊n/p⌋ + ⌊n/p²⌋ + ⌊n/p³⌋ + …

The sum continues until pᵏ > n. The result gives the highest power of p that divides n!. That is, p^vₚ(n!) divides n!, but p^(vₚ(n!)+1) does not.

  • Use Cases: Finding trailing zeros (use p = 5), checking divisibility, simplifying factorial ratios.
  • Intuition: Every multiple of p contributes one p, multiples of p² add another, and so on.

Step-by-Step Example

Question

Find the highest power of 2 that divides 100!.

Solution

  1. Step 1: Apply Legendre’s Formula:

    v₂(100!) = ⌊100/2⌋ + ⌊100/4⌋ + ⌊100/8⌋ + ⌊100/16⌋ + ⌊100/32⌋ + ⌊100/64⌋ + …

  2. Step 2: Compute each term:

    ⌊100/2⌋ = 50
    ⌊100/4⌋ = 25
    ⌊100/8⌋ = 12
    ⌊100/16⌋ = 6
    ⌊100/32⌋ = 3
    ⌊100/64⌋ = 1
    ⌊100/128⌋ = 0 (stop here)

  3. Step 3: Add them up:

    v₂(100!) = 50 + 25 + 12 + 6 + 3 + 1 = 97

  4. Final Answer:

    The highest power of 2 that divides 100! is 2⁹⁷ (exponent e = 97).

  5. Quick Check:

    For trailing zeros, we compare powers of 2 and 5. v₅(100!) = ⌊100/5⌋ + ⌊100/25⌋ = 20 + 4 = 24. Since 2s are more than 5s, number of trailing zeros = 24 ✅

Quick Variations

1. Highest power of 5 in n!: Used for trailing zeros → v₅(n!) = ⌊n/5⌋ + ⌊n/25⌋ + ⌊n/125⌋ + …

2. Highest power of p in (n choose r): Use vₚ(C(n, r)) = vₚ(n!) - vₚ(r!) - vₚ((n-r)!).

3. Stop when pᵏ > n, as higher powers contribute nothing.

Trick to Always Use

  • Step 1: Apply Legendre’s Formula - keep dividing n by p, p², p³, etc., and sum integer results.
  • Step 2: For trailing zeros, always use p = 5 since 2s are more frequent than 5s.
  • Step 3: For combination problems, use differences of factorial exponents.
  • Step 4: Stop when division result becomes 0 - further terms contribute nothing.

Summary

Summary

  • Use Legendre’s Formula to find the exponent of a prime p in n! using repeated division by p, p², p³, etc.
  • Stop when the division result becomes 0, since further terms add nothing.
  • The computed exponent vₚ(n!) gives the highest power of p that divides n! exactly.
  • This method is essential for trailing zeros (use p = 5), factorial divisibility, and combination exponent problems.

Example to remember:
v₂(100!) = 50 + 25 + 12 + 6 + 3 + 1 = 97 → highest power = 2⁹⁷.

Practice

(1/5)
1. Find the highest power of 2 that divides 50!.
easy
A. 47
B. 46
C. 48
D. 49

Solution

  1. Step 1: Apply Legendre’s formula:

    v₂(50!) = ⌊50/2⌋ + ⌊50/4⌋ + ⌊50/8⌋ + ⌊50/16⌋ + ⌊50/32⌋ + …
  2. Step 2: Compute each term:

    ⌊50/2⌋ = 25, ⌊50/4⌋ = 12, ⌊50/8⌋ = 6, ⌊50/16⌋ = 3, ⌊50/32⌋ = 1, next term ⌊50/64⌋ = 0 (stop).
  3. Step 3: Sum:

    v₂(50!) = 25 + 12 + 6 + 3 + 1 = 47.
  4. Final Answer:

    Highest power exponent = 47 → 2⁴⁷ divides 50! (Option A).
  5. Quick Check:

    All multiples of 2 contribute one 2, multiples of 4 add an extra, multiples of 8 another, etc. Summing these gives 47 ✅
Hint: Sum ⌊n/2⌋ + ⌊n/4⌋ + ⌊n/8⌋ … until terms are 0.
Common Mistakes: Forgetting to include higher powers like 16 and 32 which still contribute.
2. Find the highest power of 5 that divides 100!.
easy
A. 24
B. 23
C. 25
D. 22

Solution

  1. Step 1: Use Legendre’s formula for p = 5:

    v₅(100!) = ⌊100/5⌋ + ⌊100/25⌋ + ⌊100/125⌋ + …
  2. Step 2: Compute terms:

    ⌊100/5⌋ = 20, ⌊100/25⌋ = 4, ⌊100/125⌋ = 0 (stop).
  3. Step 3: Sum:

    v₅(100!) = 20 + 4 = 24.
  4. Final Answer:

    Highest power exponent = 24 → 5²⁴ divides 100! (Option A).
  5. Quick Check:

    This equals the number of trailing zeros of 100! because 2s are more abundant than 5s → 24 zeros ✅
Hint: Divide by 5, 25, 125, … and sum integer quotients.
Common Mistakes: Ignoring the contribution of 25, 125, etc., which add extra factors of 5.
3. Find the highest power of 3 that divides 80!.
easy
A. 35
B. 36
C. 37
D. 38

Solution

  1. Step 1: Apply Legendre’s formula for p = 3:

    v₃(80!) = ⌊80/3⌋ + ⌊80/9⌋ + ⌊80/27⌋ + ⌊80/81⌋ + …
  2. Step 2: Compute terms:

    ⌊80/3⌋ = 26, ⌊80/9⌋ = 8, ⌊80/27⌋ = 2, ⌊80/81⌋ = 0 (stop).
  3. Step 3: Sum:

    v₃(80!) = 26 + 8 + 2 = 36.
  4. Final Answer:

    Highest power exponent = 36 → 3³⁶ divides 80! (Option B).
  5. Quick Check:

    Counting multiples of 3, 9, and 27 captures every factor 3 in 80!; total 36 ✅
Hint: Divide by 3, 9, 27, … until quotient 0 and sum results.
Common Mistakes: Stopping after ⌊n/3⌋ and forgetting contributions from 9 and 27.
4. Find the highest power of 7 that divides 200!.
medium
A. 31
B. 33
C. 32
D. 34

Solution

  1. Step 1: Legendre’s formula for p = 7:

    v₇(200!) = ⌊200/7⌋ + ⌊200/49⌋ + ⌊200/343⌋ + …
  2. Step 2: Compute terms:

    ⌊200/7⌋ = 28, ⌊200/49⌋ = 4, ⌊200/343⌋ = 0 (stop).
  3. Step 3: Sum:

    v₇(200!) = 28 + 4 = 32.
  4. Final Answer:

    Highest power exponent = 32 → 7³² divides 200! (Option C).
  5. Quick Check:

    Terms beyond 49 (e.g., 343) exceed 200 so they contribute 0; total 32 ✅
Hint: Divide by 7, 49, 343, … until terms are zero and sum them.
Common Mistakes: Including p^k larger than n or forgetting the 49-term.
5. Find the highest power of 11 that divides 500!.
medium
A. 48
B. 50
C. 47
D. 49

Solution

  1. Step 1: Apply Legendre’s formula for p = 11:

    v₁₁(500!) = ⌊500/11⌋ + ⌊500/121⌋ + ⌊500/1331⌋ + …
  2. Step 2: Compute terms:

    ⌊500/11⌋ = 45, ⌊500/121⌋ = 4, ⌊500/1331⌋ = 0 (stop).
  3. Step 3: Sum:

    v₁₁(500!) = 45 + 4 = 49.
  4. Final Answer:

    Highest power exponent = 49 → 11⁴⁹ divides 500! (Option D).
  5. Quick Check:

    Only 11 and 121 contribute (11³ = 1331 > 500), giving total 49 ✅
Hint: Add ⌊n/11⌋ + ⌊n/121⌋ + … until zero.
Common Mistakes: Forgetting the 121 term which adds extra factors of 11.

Mock Test

Ready for a challenge?

Take a 10-minute AI-powered test with 10 questions (Easy-Medium-Hard mix) and get instant SWOT analysis of your performance!

10 Questions
5 Minutes