Chapter

p-adic Valuations

A module on prime exponents in numbers, factorials, binomial coefficients, and maximal divisibility powers.
Log in to track solved progress and bookmarks.

Theory

Key Idea

\(v_p(n)\) is the exponent of the prime \(p\) in the factorisation of \(n\). Instead of asking whether a number is divisible, we ask how many times it is divisible by \(p\). This turns problems about prime powers, factorials, and binomial coefficients into exact computations.

Basic Facts

If \(p\) is prime, then \(v_p(ab)=v_p(a)+v_p(b)\), and \(v_p(a^k)=k v_p(a)\). For factorials we use Legendre's formula: \(v_p(n!)=\lfloor n/p \rfloor+\lfloor n/p^2 \rfloor+\lfloor n/p^3 \rfloor+\cdots\). The number of trailing zeros of \(n!\) in decimal notation is \(v_5(n!)\), because there are more factors \(2\) than factors \(5\).

When to Use This Method

Use valuations when the problem asks for the largest \(k\) such that \(p^k\mid N\), or when factorials, products of consecutive integers, binomial coefficients, trailing zeros, or divisibility by a composite number \(2^a3^b5^c\) appear.

How to Recognise the Method

Phrases such as largest power, number of zeros, divisible by \(m^k\), or find the exponent of a prime almost always point to \(v_p\). If the number is composite, factor it into primes and take the minimum of the resulting restrictions.

Typical Mistakes

Do not count only multiples of \(p\): multiples of \(p^2\) contribute extra. For decimal zeros, the limiting factor is the number of fives, not twos. For \(m^k\mid N\), where \(m\) is composite, every prime divisor of \(m\) must be considered.

Mini-checklist

1. Which prime \(p\) matters? 2. Should the modulus be factored? 3. For a factorial, has Legendre's formula included all powers of \(p\)? 4. For a composite base, has the minimum been taken? 5. Is the found exponent truly maximal?

Examples

Example 1. First Computation of \(v_p\)

This teaches reading a factorisation.

Problem. Find \(v_2(72)\) and \(v_3(72)\).

Solution.

We have \(72=2^3\cdot3^2\). Therefore \(v_2(72)=3\), and \(v_3(72)=2\).

Comment. This is not the number of divisors, but the exponent of a specific prime.

Example 2. Legendre's Formula

This shows how to count the exponent of a prime in a factorial.

Problem. Find \(v_3(100!)\).

Solution.

By Legendre's formula, \(v_3(100!)=\lfloor100/3\rfloor+\lfloor100/9\rfloor+\lfloor100/27\rfloor+\lfloor100/81\rfloor=33+11+3+1=48\).

Comment. Multiples of \(9\) and \(27\) contribute extra factors of \(3\).

Example 3. Decimal Zeros

This connects valuations with decimal notation.

Problem. How many zeros are at the end of \(100!\)?

Solution.

The number of zeros equals the number of factors \(10=2\cdot5\). There are more twos than fives in a factorial, so count fives: \(v_5(100!)=20+4=24\). Answer: \(24\).

Comment. For decimal notation, fives are almost always the limiting factor.

Example 4. Divisibility by a Composite Power

This teaches taking the minimum over prime divisors.

Problem. Find the largest \(k\) such that \(12^k\mid100!\).

Solution.

Since \(12=2^2\cdot3\), we need \(2k\le v_2(100!)\) and \(k\le v_3(100!)\). Now \(v_2(100!)=50+25+12+6+3+1=97\), and \(v_3(100!)=48\). Hence \(k\le48\) from twos and \(k\le48\) from threes. Answer: \(48\).

Comment. Always factor a composite base.

Example 5. A Binomial Coefficient

This shows valuation for a quotient of factorials.

Problem. Find \(v_2\left(\binom{16}{6}\right)\).

Solution.

Use \(\binom{16}{6}=16!/(6!10!)\). Then \(v_2(16!)=8+4+2+1=15\), \(v_2(6!)=3+1=4\), \(v_2(10!)=5+2+1=8\). Thus \(v_2\left(\binom{16}{6}\right)=15-4-8=3\).

Comment. For binomial coefficients, exponents are subtracted.

Example 6. Zeros in Another Base

This shows that the base need not be decimal.

Problem. How many zeros are at the end of \(100!\) in base \(12\)?

Solution.

The base is \(12=2^2\cdot3\). We need the maximum \(k\) such that \(12^k\mid100!\). From above, \(v_2(100!)=97\), \(v_3(100!)=48\). Hence \(k=\min(\lfloor97/2\rfloor,48)=48\).

Comment. This is the same as \(12^k\mid100!\), but in a different form.

Example 7. Why \(2^n\nmid n!\)

This prepares for proof problems.

Problem. Prove that for every \(n\ge1\), the number \(n!\) is not divisible by \(2^n\).

Solution.

By Legendre's formula, \(v_2(n!)=\lfloor n/2\rfloor+\lfloor n/4\rfloor+\cdots\). Each term is strictly less than the corresponding term of the geometric sum \(n/2+n/4+\cdots=n\). Therefore \(v_2(n!)

Comment. Estimating the sum of floors is often easier than finding the exact value.

Example 8. A Product of Consecutive Integers

Olympiad idea: prove divisibility through \(v_p\).

Problem. Prove that the product of any \(n\) consecutive integers is divisible by \(n!\).

Solution.

Let the product be \(A=(m+1)(m+2)\cdots(m+n)\). For every prime \(p\), we prove \(v_p(A)\ge v_p(n!)\). Among \(n\) consecutive integers, at least \(\lfloor n/p\rfloor\) are divisible by \(p\), at least \(\lfloor n/p^2\rfloor\) are divisible by \(p^2\), and so on. Hence \(v_p(A)\ge\sum_i\lfloor n/p^i\rfloor=v_p(n!)\). This holds for every prime \(p\), so \(n!\mid A\).

Comment. This proof is equivalent to the integrality of a binomial coefficient.

Problems

Problems

#5.1
#5.1

Exponent of Two

Prime Factorisation Grade 8 Grade 9 Grade 10 ★★☆☆☆

Find \(v_2(72)\).

Details
Problem: NT-B2-M05-P001
Difficulty: Level 2 of 5
Tag: Prime Factorisation
Grade: Grade 8, Grade 9, Grade 10
#5.2
#5.2

Exponent of Five

Prime Factorisation Grade 8 Grade 9 Grade 10 ★★☆☆☆

Find \(v_5(1000)\).

Details
Problem: NT-B2-M05-P002
Difficulty: Level 2 of 5
Tag: Prime Factorisation
Grade: Grade 8, Grade 9, Grade 10
#5.3
#5.3

Threes in \(50!\)

Factorials Grade 8 Grade 9 Grade 10 ★★☆☆☆

Find \(v_3(50!)\).

Details
Problem: NT-B2-M05-P003
Difficulty: Level 2 of 5
Tag: Factorials
Grade: Grade 8, Grade 9, Grade 10
#5.4
#5.4

Zeros in \(80!\)

Trailing Zeros Grade 8 Grade 9 Grade 10 ★★☆☆☆

How many trailing zeros does \(80!\) have in decimal notation?

Details
Problem: NT-B2-M05-P004
Difficulty: Level 2 of 5
Tag: Trailing Zeros
Grade: Grade 8, Grade 9, Grade 10
#5.5
#5.5

Twos in \(100!\)

Factorials Grade 8 Grade 9 Grade 10 ★★☆☆☆

Find the largest \(k\) such that \(2^k\mid100!\).

Details
Problem: NT-B2-M05-P005
Difficulty: Level 2 of 5
Tag: Factorials
Grade: Grade 8, Grade 9, Grade 10
#5.6
#5.6

Twos in \(2026!\)

Factorials Grade 8 Grade 9 Grade 10 ★★★☆☆

Find \(v_2(2026!)\).

Details
Problem: NT-B2-M05-P006
Difficulty: Level 3 of 5
Tag: Factorials
Grade: Grade 8, Grade 9, Grade 10
#5.7
#5.7

Power of \(12\)

Divisibility Grade 8 Grade 9 Grade 10 ★★★☆☆

Find the largest \(k\) such that \(12^k\mid100!\).

Details
Problem: NT-B2-M05-P007
Difficulty: Level 3 of 5
Tag: Divisibility
Grade: Grade 8, Grade 9, Grade 10
#5.8
#5.8

A Binomial Coefficient

Binomial Coefficients Grade 8 Grade 9 Grade 10 ★★★☆☆

Find \(v_3\left(\binom{30}{10}\right)\).

Details
Problem: NT-B2-M05-P008
Difficulty: Level 3 of 5
Tag: Binomial Coefficients
Grade: Grade 8, Grade 9, Grade 10
#5.9
#5.9

Product

Proof Grade 8 Grade 9 Grade 10 ★★★☆☆

Prove that \(v_p(ab)=v_p(a)+v_p(b)\) for prime \(p\).

Details
Problem: NT-B2-M05-P009
Difficulty: Level 3 of 5
Tag: Proof
Grade: Grade 8, Grade 9, Grade 10
#5.10
#5.10

Base \(12\)

Trailing Zeros Grade 8 Grade 9 Grade 10 ★★★☆☆

How many trailing zeros does \(100!\) have in base \(12\)?

Details
Problem: NT-B2-M05-P010
Difficulty: Level 3 of 5
Tag: Trailing Zeros
Grade: Grade 8, Grade 9, Grade 10
#5.11
#5.11

Why \(2^n\) Is Too Large

Factorials Grade 8 Grade 9 Grade 10 ★★★★☆

Prove that \(2^n\nmid n!\) for every positive integer \(n\).

Details
Problem: NT-B2-M05-P011
Difficulty: Level 4 of 5
Tag: Factorials
Grade: Grade 8, Grade 9, Grade 10
#5.12
#5.12

Power of \(30\)

Divisibility Grade 8 Grade 9 Grade 10 ★★★★☆

Find the largest \(k\) such that \(30^k\mid200!\).

Details
Problem: NT-B2-M05-P012
Difficulty: Level 4 of 5
Tag: Divisibility
Grade: Grade 8, Grade 9, Grade 10
#5.13
#5.13

Not Divisible by \(5\)

Binomial Coefficients Grade 8 Grade 9 Grade 10 ★★★★☆

Find \(v_5\left(\binom{100}{25}\right)\).

Details
Problem: NT-B2-M05-P013
Difficulty: Level 4 of 5
Tag: Binomial Coefficients
Grade: Grade 8, Grade 9, Grade 10
#5.14
#5.14

The Product \(i(i+1)\)

P Adic Valuations Grade 8 Grade 9 Grade 10 ★★★★☆

Find the largest \(k\) such that \(2^k\mid\prod_{i=1}^{100} i(i+1)\).

Details
Problem: NT-B2-M05-P014
Difficulty: Level 4 of 5
Tag: P Adic Valuations
Grade: Grade 8, Grade 9, Grade 10
#5.15
#5.15

Exponent in a Quotient

Factorials Grade 8 Grade 9 Grade 10 ★★★★☆

Find \(v_2\left(\frac{100!}{50!}\right)\).

Details
Problem: NT-B2-M05-P015
Difficulty: Level 4 of 5
Tag: Factorials
Grade: Grade 8, Grade 9, Grade 10
#5.16
#5.16

The Central Coefficient Is Even

Binomial Coefficients Grade 8 Grade 9 Grade 10 ★★★★★

Prove that \(\binom{2n}{n}\) is even for every positive integer \(n\).

Details
Problem: NT-B2-M05-P016
Difficulty: Level 5 of 5
Tag: Binomial Coefficients
Grade: Grade 8, Grade 9, Grade 10
#5.17
#5.17

Consecutive Integers

P Adic Valuations Grade 8 Grade 9 Grade 10 ★★★★★

Prove that the product of any \(n\) consecutive integers is divisible by \(n!\).

Details
Problem: NT-B2-M05-P017
Difficulty: Level 5 of 5
Tag: P Adic Valuations
Grade: Grade 8, Grade 9, Grade 10
#5.18
#5.18

When There Are Almost Enough Twos

Factorials Grade 8 Grade 9 Grade 10 ★★★★★

Find all positive integers \(n\) such that \(2^{n-1}\mid n!\).

Details
Problem: NT-B2-M05-P018
Difficulty: Level 5 of 5
Tag: Factorials
Grade: Grade 8, Grade 9, Grade 10
#5.19
#5.19

Factorial and a Square

Factorials Grade 8 Grade 9 Grade 10 ★★★★★

Find the largest \(k\) such that \(36^k\mid150!\).

Details
Problem: NT-B2-M05-P019
Difficulty: Level 5 of 5
Tag: Factorials
Grade: Grade 8, Grade 9, Grade 10
#5.20
#5.20

Impossible Divisibility

Contradictions Grade 8 Grade 9 Grade 10 ★★★★★

Prove that \(n!\) is not divisible by \(3^n\) for any positive integer \(n\).

Details
Problem: NT-B2-M05-P020
Difficulty: Level 5 of 5
Tag: Contradictions
Grade: Grade 8, Grade 9, Grade 10

Ladders

No published ladders were found.
Previous Chapter
Next Chapter