KomFi. Academy

Legendre's Formula

GMAT glossary · Playbook

Definition

The exponent of a prime p in n! is E = lfloor n/p rfloor + lfloor n/p^2 rfloor + lfloor n/p^3 rfloor + cdots.

Legendre's Formula in plain English

Pull Legendre's Formula when you need the exponent of a prime p inside n!. Clues include Exponent of p in n!, how many times p divides n!, trailing zeros. Blueprint: E=lfloor n/prfloor+lfloor n/p^2rfloor+lfloor n/p^3rfloor+cdots until the floors hit zero. Why it beats the long way: Expanding n! is impossible for large n. Legendre counts multiples without writing the product. Micro-example: Exponent of 5 in 100!: lfloor 100/5 rfloor + lfloor 100/25 rfloor + lfloor 100/125 rfloor = 20 + 4 + 0 = 24. That is also the trailing-zero count, since factors of 2 are more plentiful.

Sign up free: all 257 GMAT terms as flashcards, plus practice questions with full explanations →

Related GMAT terms

GMAT practice questions · GMAT flashcards · GMAT study guide