Lifting the exponent lemma explained for competitions
18 October 2026
Lifting the exponent is not hard to learn. The statement is one line, and the proof is a page you can rebuild yourself. What goes wrong in a contest is the other two things: people apply it at with the odd-prime formula and get a confidently wrong answer, and people fail to notice that a problem wants it at all, because the problem never says "valuation".
This is the lemma explained the way competitions test it. It gives the statement once, spends most of its time on the trap, and then on recognition.
The statement
Write for the exponent of the prime in : because . Lifting the exponent (LTE) answers one question: what is ?
For an odd prime with , and dividing neither nor :
That is the whole lemma. The exponent of in a huge number is the exponent in a small number plus the exponent in . Nothing about the size of matters.
A first example. How many times does divide ? Here , , and , with dividing neither nor . So . You never wrote down a number with seventeen digits.
There is a plus version for odd . If is odd, , divides neither nor , and is odd, then
It is the minus version with replaced by , which is why has to be odd. For even it does not just change, it collapses: gives , which is not divisible by at all.
The p = 2 trap
Every LTE mistake worth worrying about lives here. For , with and both odd:
- if is odd, ;
- if is even, .
The even case has an extra term, , and it is never zero, because is even. So the odd-prime formula is not a rough version of the right answer at . It is wrong every single time is even.
Watch it fail. Take . The odd-prime formula says . The real formula says . The answer is : is divisible by and not by .
Where does the extra term come from? From the very first factor. , and that already holds two factors of , not one. For odd , the sum is never divisible by when is, so it never shows up. For , it always does.
A contest-shaped example: the largest power of dividing . Here is even, so . The answer is .
Why it is true
You will write LTE as a cited lemma, not prove it in the exam, but knowing the proof is what stops you misapplying it. It is two cases, both built on the factorisation
It is the same identity that settles why can only be prime when is, and that drives the gcd of and . LTE is what you get when you ask that factorisation how many factors of it holds.
Case 1. Suppose does not divide . Modulo we have , so each of the terms in the bracket is , and the bracket is . Neither nor is divisible by , so the bracket is not. All the factors of sit in , and , which is the formula with .
Case 2. Suppose . Now the bracket has terms. A slightly finer count, writing and expanding each term to first order in , shows the bracket is divisible by exactly once, provided is odd. So each factor of in adds exactly one to the valuation. Apply this times and Case 1 to whatever is left of , and the formula follows.
The condition that is odd is the whole story. At the bracket is , and for , that is , divisible by twice. That is the extra term from the last section, appearing in the proof exactly where you would expect it.
This is modular thinking at its most economical: you never compute , only what it looks like modulo and .
When to reach for it
LTE problems rarely say "find ". They say one of these:
- The direct form. "Find the largest power of dividing …", followed by something of the shape . This is the easiest one to see.
- The exponent on both sides. "Find all such that divides ", where the exponent appears on both sides. Whenever the unknown sits in an exponent and in the power of you are dividing by, LTE turns the divisibility into an inequality between two small numbers.
- A variable dividing itself. " divides " and its relatives, where a variable divides an expression in itself. These are hard, but LTE is usually the step that bounds the prime factors of .
- Repeated squaring. Expressions like or have an exponent that is a pure prime power, which is the case LTE handles most cleanly. For instance , by the plus version.
Here is the second signal at work. Find all positive with . If is odd, , so we need , which gives . If is even, , and we need . Since grows like a logarithm and does not, this fails quickly: it holds at and and nowhere after. The answer is . Check the edges: is divisible by , and is not divisible by .
Notice that the whole problem was decided by the formula. Use the odd-prime version and you get , which loses .
When the hypothesis fails
LTE needs . Often a problem hands you a prime that does not divide , and the fix is to raise to the order first.
Take . Since does not divide , LTE does not apply as written. But , and is the smallest such exponent. So rewrite , where . Now LTE gives .
The other hypothesis, that divides neither nor , is the one people forget to check. If and , pull out the common power of first and apply LTE to what remains. Skipping that check is how a correct formula produces a wrong number.
What to do with this
Valuation arguments are a habit more than a formula. The same move of tracking one prime at a time, rather than the whole number, is what proves the harmonic sum is never an integer, where everything turns on the single term with the largest power of . LTE is that habit with a closed form attached.
To make it stick, take ten problems of the forms above and for each one write three lines only: which prime, which hypothesis you checked, and which formula you used, with and even flagged every time. The problem archive has the number theory problems linked here in full, and the daily problem posts a fresh one every day if you want to keep the recognition warm.
Related guides
- gcd(2^m − 1, 2^n − 1): the proof, and how to spot itWhy gcd(2^m − 1, 2^n − 1) = 2^gcd(m,n) − 1: run Euclid's algorithm on the exponents. A full proof, a second proof by orders, and where it turns up.
- How to build a problem-solving notebook that actually worksMost problem notebooks are copied solutions nobody reopens. Index yours by the clue in the statement, not by topic, and test it from the clue side.
- What separates a Level 5 problem from a Level 7, side by sideTwo IMO inequalities, both rated 5 out of 6, sit two rungs apart on the ladder. What actually separates a Level 5 problem from a Level 7, and how to cross.
- Number theory problems that look like algebra, and how to tellAn equation, a fraction, a polynomial: it reads like algebra, but the word integer changes the method. Five signals, and the three moves that follow.
Train it on Lemma
Every technique here is taught explicitly, in order. 125 lessons, 1206 curated problems and unlimited generated practice at six difficulties. Free to start, no card, and every paid plan opens with 3 free days.
Find your level