v₂(10!)
⌊10/2⌋ + ⌊10/4⌋ + ⌊10/8⌋
5 + 2 + 1 = 8.
The exponent of a prime in is
This page is easier if you are comfortable with:
Among the numbers , exactly are multiples of and each contributes at least one factor ; then of them contribute a second factor, and so on. Adding these counts gives the formula. The floor function is described in Hermite's identity, and factorials are part of binomial coefficients.
The most common use is counting trailing zeros: the number of zeros at the end of is , since there are always more factors of 2 than 5. The formula also tells you the largest power of a prime dividing a binomial coefficient, and helps with prime factor form, the number of divisors and the sum of divisors of .
The sum stops as soon as . A related result describes where primes occur among the integers, see the prime number theorem, and the divisibility tests in the rule for 11 use similar remainder thinking.
Legendre's formula counts how many times a prime divides a factorial. The most familiar use is counting the zeros at the end of n!.
The three bars add to 8, the number of factors 2 in 10! = 3628800 = 2⁸ × 14175.
These examples are worked by hand, step by step, so you can compare your own working.
Find the exponent of 2 in .
How many zeros are at the end of ?
Find the exponent of 7 in .
A few situations come up again and again. Knowing them saves time and helps you spot answers that cannot be right.
⌊10/2⌋ + ⌊10/4⌋ + ⌊10/8⌋
5 + 2 + 1 = 8.
20 + 4
24.
6 + 2
8.
10 + 2
12.
v_p(n!) = ⌊n/p⌋ + ⌊n/p²⌋ + ⌊n/p³⌋ + …. Trailing zeros of n! equal v₅(n!).
⌊10/2⌋ + ⌊10/4⌋ + ⌊10/8⌋.
⌊100/5⌋ + ⌊100/25⌋.
⌊20/3⌋ + ⌊20/9⌋.
50!: ⌊50/5⌋ + ⌊50/25⌋.
first term ✗
add higher powers ✓
p², p³.
wrong prime ✗
count 5s ✓
Fewer 5s.
ceiling ✗
floor ✓
Integer part.
formula ✗
prime p only ✓
Prime.
Try each one on paper, then open the answer. Use the solver above to see the full working.
7
4
6
7
8
49
Unlimited fresh questions with instant marking. Choose a level, work it out on paper, then type your answer.
Solve: …
v_p(n!) = Σ⌊n/pᵏ⌋.
24.
There are always more 2s than 5s.
When pᵏ > n.
divisibility rule for 11.
More in Discrete maths and number theory and the formula sheets.