Prime Valuations
Section titled βPrime ValuationsβFor a prime and a nonzero integer , the valuation is the exponent of in the prime factorization of . For example, , so and . Set when needed.
Products and powers become addition and multiplication of exponents:
For nonzero rationals, define . For sums, we only have
with equality if the two valuations differ. Equal valuations can allow extra cancellation, so valuations do not distribute over addition.
Example. Find the largest power of two dividing .
Since and ,
The largest power is , meaning divides the number but does not.
Factorials and Legendreβs Formula
Section titled βFactorials and Legendreβs FormulaβIn , every multiple of contributes a factor of , every multiple of contributes another, and so on. This gives Legendreβs formula:
The sum is finite because the terms become zero once .
Example. Find the number of trailing decimal zeros in .
A zero needs a factor of ten, so its count is . There are more factors of two than five, and
Thus ends in exactly zeros.
For base , the number of trailing base- zeros is . Dividing by the base exponents is essential for bases such as twelve or one hundred.
Binomial Coefficients
Section titled βBinomial CoefficientsβUse the factorial definition to subtract valuations:
This determines prime divisibility without calculating the binomial coefficient itself.
Example. Find the exponent of two in .
Legendre gives and . Therefore
The binomial coefficient is divisible by four but not eight.
LTE for Odd Primes
Section titled βLTE for Odd PrimesβThe lifting-the-exponent lemma, or LTE, finds the exact valuation of certain differences of powers. If is an odd prime, , , and , then
Assume the difference is nonzero when asking for a finite exponent. The lemma says that once agree modulo and neither contains a factor of , raising to the th power adds exactly the exponent of in .
For odd , replacing by gives the sum version:
provided and . The oddness of is required for this rewrite.
Example. Find the largest exponent such that .
The prime three is odd, , and . Thus LTE applies:
Example. Find .
Here is odd, , and . The sum version gives
The Prime Two
Section titled βThe Prime TwoβFor odd integers , the two-adic formulas depend on the exponentβs parity. If is odd,
If is even,
For odd , we also have . For even and odd , each even power is one modulo eight, so .
Example. Find .
Both bases are odd and the exponent is even, so
Using the odd-prime formula would incorrectly give three.
Why Valuation Rules Work
Section titled βWhy Valuation Rules WorkβWrite and with . If , then
and the factor in parentheses is not divisible by . Therefore . If , the unit terms may cancel modulo and create extra powers. This proves the unequal-valuation rule and explains why equal valuations need more information.
The same argument applies to a difference. It is useful before LTE: sometimes the two terms already have unequal valuations, so the answer is immediate and lifting is unnecessary.
Example. Find .
The two valuations are twenty and forty. Because they differ, the difference has valuation twenty. Equivalently,
and the parenthetical factor is not divisible by three.
Legendreβs Formula and Base Digits
Section titled βLegendreβs Formula and Base DigitsβLet be the sum of the base- digits of . Legendreβs formula can be rewritten as
To derive it, write . The floor sum counts a digit with total weight . Summing the contributions gives the formula.
The digit version is especially useful for powers of the base or for differences of factorial valuations, where the large linear terms cancel.
Example. Find the exponent of two in .
The binary digit sums are and . Therefore
The coefficient is divisible by eight but not sixteen. No factorial or binomial coefficient needs to be evaluated.
For base , the general binomial valuation becomes
Every carry in adding and reduces the combined digit sum by , including carries propagated through several positions. Thus this valuation equals the number of carries. This is Kummerβs theorem, with the carry interpretation derived directly from Legendre.
A Catalan Parity Classification
Section titled βA Catalan Parity ClassificationβThe factorial form of a Catalan number is . Applying the binary digit formula and using gives
A positive integer has binary digit sum one exactly when it is a power of two. Consequently, is odd exactly when for some .
Example. Determine whether and are odd, and find their exact powers of two.
For , the number has one binary one, so and the Catalan number is odd.
For , the number has two binary ones, so . It is even but not divisible by four.
This is a useful example of a structural answer replacing a large calculation. The numerical values of the Catalan numbers are irrelevant to their parity.
A Proof of Odd-Prime LTE
Section titled βA Proof of Odd-Prime LTEβAssume is odd, , and . First suppose the exponent is not divisible by . Factoring a difference of powers gives
Thus raising to an exponent prime to adds no new valuation.
Next consider exponent . Write with . In the binomial expansion of , the first term has valuation . Every other term has valuation at least : the intermediate binomial coefficients contain , and the final term has valuation .
The unequal-valuation principle therefore gives
Finally write with . The first step preserves the original valuation, and each of the exponent- steps adds one. Hence .
The proof also explains the exceptional behavior at two: the final binomial term may tie the first termβs valuation rather than lying strictly above it, permitting additional cancellation.
Preparing an Expression Before LTE
Section titled βPreparing an Expression Before LTEβIf , the lemmaβs difference form does not apply. An order calculation or a parity condition may let us group powers so that the new bases do agree modulo .
If both bases contain , remove the common prime-power factor first. LTE concerns unit bases, not arbitrary multiples of the prime.
Example. Find .
Factor the common term:
The first factor has valuation twenty. For the second, write . Now three divides and divides neither base, so LTE gives
The total valuation is twenty-one. Applying LTE directly to bases six and twelve would violate the coprimality hypothesis.
A Least-Exponent Problem Combining Several Primes
Section titled βA Least-Exponent Problem Combining Several PrimesβWhen a target divisor contains several prime powers, translate each into a valuation inequality. The least exponent must satisfy all resulting divisibility conditions simultaneously.
Example. Find the smallest positive such that .
For three, LTE applies directly:
Thus .
Modulo eleven, ten is negative one, so must be even. Write and apply LTE to :
Therefore eleven divides , equivalently twenty-two divides . Combining the conditions gives
Both valuation inequalities hold at this value, so the necessary conditions are also sufficient.
A single prime condition may force a preliminary rewrite before another theorem becomes usable. Here parity determined the exponent form before the eleven-adic calculation. Establish that information in the solution rather than applying a formula with an unresolved parity parameter.
When Valuations Prove an Impossibility
Section titled βWhen Valuations Prove an ImpossibilityβIf an equation asserts that an expression is a perfect th power, every finite prime valuation must be a multiple of . Finding one prime whose valuation is forced into the wrong residue class rules out the equation.
For example, for positive odd , the formula immediately rules out a square whenever is even. This is a conditional obstruction, not a full classification: if the valuation is even, other primes may still prevent a square.
Square Roots of One Modulo Powers of Two
Section titled βSquare Roots of One Modulo Powers of TwoβFor , the congruence has four solutions:
To prove completeness, must be odd. The factors are consecutive even numbers, so one has valuation exactly one and the other has valuation at least two. Their product has valuation at least only if the second factor has valuation at least .
Thus or negative one modulo , giving the four classes above modulo . Squaring each class verifies that it works.
For modulus sixty-four, the solutions are one, thirty-one, thirty-three, sixty-three. This differs from an odd prime power, which has only the two sign roots. The exceptional two-adic LTE formula reflects the same split between the valuations of and .
Inverting Legendreβs Formula
Section titled βInverting Legendreβs FormulaβSometimes the question asks for the smallest factorial containing a required prime power. The valuation is nondecreasing in but may jump by more than one at a multiple of a high prime power.
Example. Find the smallest such that .
Legendre gives
The valuation is nondecreasing, so every earlier factorial has valuation below twenty, while forty-five factorial has enough. The smallest is forty-five.
There is no factorial valuation equal to twenty at this transition. Searching for equality rather than the inequality would miss the correct threshold.
For larger targets, a monotone search can bracket the smallest . The approximation supplies a quick necessary lower bound, while the exact floor sum settles the final neighboring values.
A Unique Least Valuation Cannot Cancel
Section titled βA Unique Least Valuation Cannot CancelβFor several nonzero terms, if exactly one term has the smallest -valuation, their sum has that same valuation. Factor out the common smallest power; one remaining term is a unit modulo and all others are divisible by .
This gives an impossibility test for rational sums. A rational number is an integer only if all its prime valuations are nonnegative.
Example. Prove that is not an integer when are positive integers.
At the prime two, the valuations of the three summands are . The smallest valuation is unique, so the sum has valuation . Therefore it cannot be an integer.
This proof avoids a large common denominator and identifies exactly which prime obstructs integrality. If two least valuations tied, cancellation could occur and a further argument would be needed.
Trailing Zeros in a Composite Base
Section titled βTrailing Zeros in a Composite BaseβA base-zero count compares each available prime exponent with the number required for one copy of the base. The scarcest raw prime exponent need not be the bottleneck after this division.
For , Legendre gives and . In base , the trailing-zero count is
Each zero consumes three twos and two threes. Counting only factors of the largest prime, as in ordinary decimal factorial problems, would not be justified for an arbitrary base.
Prime Binomial Coefficients and Congruences
Section titled βPrime Binomial Coefficients and CongruencesβFor a prime and , the numerator of contains exactly one factor of and neither denominator factorial contains one. Hence .
Applying the binomial theorem gives
for integers . Every middle coefficient vanishes modulo the prime. This congruence does not generally hold modulo , because those coefficients have valuation exactly one rather than at least two.
The valuation calculation therefore explains both the useful congruence and its limitation at the next prime power.