Maths WorkshopMaths problems with full solutions
Exercise 928Number theory › Divisibility and gcdL1Added 3 Nov 2026

Prime power divisibility

#prime power#valuation#p-adic

Statement

Let pp be prime and n≥1n\ge1. Show that the exponent of pp in n!n! is
vp(n!)=∑k≥1⌊npk⌋.v_p(n!)=\sum_{k\ge1}\left\lfloor\frac{n}{p^k}\right\rfloor.

Hint

Count multiples of pp, then of p2p^2, etc. Multiples of pkp^k each contribute at least kk to the exponent.

Show solutionHide solution

Solution

Counting. Among 1,…,n1,\ldots,n, the number of multiples of pp is ⌊n/p⌋\lfloor n/p\rfloor; multiples of p2p^2 is ⌊n/p2⌋\lfloor n/p^2\rfloor; etc.

Sum. The exponent of pp in n!n! is the sum over k≥1k\ge1 of the number of multiples of pkp^k, since a multiple of pkp^k contributes kk to the exponent (counted once for pp, once for p2p^2, ..., once for pkp^k).

Conclusion. vp(n!)=∑k≥1⌊n/pk⌋v_p(n!)=\sum_{k\ge1}\lfloor n/p^k\rfloor.

Example. v2(10!)=⌊10/2⌋+⌊10/4⌋+⌊10/8⌋=5+2+1=8v_2(10!)=\lfloor10/2\rfloor+\lfloor10/4\rfloor+\lfloor10/8\rfloor=5+2+1=8.