Lifting-the-exponent lemma

In elementary number theory, the lifting-the-exponent lemma (LTE lemma) provides several formulas for computing the p-adic valuation $$\nu_p$$ of special forms of integers. The lemma is named as such because it describes the steps necessary to "lift" the exponent of $$p$$ in such expressions. It is related to Hensel's lemma.

Background
The exact origins of the LTE lemma are unclear; the result, with its present name and form, has only come into focus within the last 10 to 20 years. However, several key ideas used in its proof were known to Gauss and referenced in his Disquisitiones Arithmeticae. Despite chiefly featuring in mathematical olympiads, it is sometimes applied to research topics, such as elliptic curves.

Statements
For any integers $$x, y$$, a positive integer $$n$$, and a prime number $$p$$ such that $$p \nmid x$$ and $$p \nmid y$$, the following statements hold:


 * When $$p$$ is odd:
 * If $$p \mid x-y$$, then $$\nu_p(x^n-y^n) = \nu_p(x-y)+\nu_p(n)$$.
 * If $$n$$ is odd and $$p \mid x+y$$, then $$\nu_p(x^n+y^n) = \nu_p(x+y)+\nu_p(n)$$.
 * If $$n$$ is even and $$p \mid x+y$$, then $$\nu_p(x^n+y^n) = 0$$.
 * When $$p = 2$$:
 * If $$2 \mid x-y$$ and $$n$$ is even, then $$\nu_2(x^n-y^n) = \nu_2(x-y)+\nu_2(x+y)+\nu_2(n)-1$$.
 * If $$2 \mid x-y$$ and $$n$$ is odd, then $$\nu_2(x^n-y^n) = \nu_2(x-y)$$. (Follows from the general case below.)
 * Corollaries:
 * If $$4 \mid x-y$$, then $$\nu_2(x+y)=1$$ and thus $$\nu_2(x^n-y^n) = \nu_2(x-y)+\nu_2(n)$$.
 * If $$2 \mid x+y$$ and $$n$$ is even, then $$\nu_2(x^n+y^n) = 1$$.
 * If $$2 \mid x+y$$ and $$n$$ is odd, then $$\nu_2(x^n+y^n) = \nu_2(x+y)$$.
 * For all $$p$$:
 * If $$\gcd(n,p) = 1$$ and $$p \mid x-y$$, then $$\nu_p(x^n-y^n) = \nu_p(x-y)$$.
 * If $$\gcd(n,p) = 1$$, $$p \mid x+y$$ and $$n$$ odd, then $$\nu_p(x^n+y^n) = \nu_p(x+y)$$.

Generalizations
LTE has been generalized to complex values of $$x, y$$ provided that the value of $$\tfrac{x^n-y^n}{x-y}$$ is integer.

Base case
The base case $$\nu_p(x^n-y^n) = \nu_p(x-y)$$ when $$\gcd(n,p) = 1$$ is proven first. Because $$p \mid x-y \iff x \equiv y \pmod{p}$$,

x^{n-1}+x^{n-2}y+x^{n-3}y^2+\dots+y^{n-1} \equiv nx^{n-1} \not\equiv 0 \pmod{p}\ (1) $$

The fact that $$x^n-y^n = (x-y)(x^{n-1}+x^{n-2}y+x^{n-3}y^2+\dots+y^{n-1})$$ completes the proof. The condition $$\nu_p(x^n+y^n) = \nu_p(x+y)$$ for odd $$n$$ is similar.

General case (odd p)
Via the binomial expansion, the substitution $$y = x+kp$$ can be used in (1) to show that $$\nu_p(x^p-y^p) = \nu_p(x-y)+1$$ because (1) is a multiple of $$p$$ but not $$p^2$$. Likewise, $$\nu_p(x^p+y^p) = \nu_p(x+y)+1$$.

Then, if $$n$$ is written as $$p^ab$$ where $$p \nmid b$$, the base case gives $$\nu_p(x^n-y^n) = \nu_p((x^{p^a})^b-(y^{p^a})^b) = \nu_p(x^{p^a}-y^{p^a})$$. By induction on $$a$$,

\begin{align} \nu_p(x^{p^a}-y^{p^a}) &= \nu_p(((\dots(x^p)^p\dots))^p-((\dots(y^p)^p\dots))^p)\ \text{(exponentiation used } a \text{ times per term)} \\ &= \nu_p(x-y)+a \end{align} $$

A similar argument can be applied for $$\nu_p(x^n+y^n)$$.

General case (p = 2)
The proof for the odd $$p$$ case cannot be directly applied when $$p = 2$$ because the binomial coefficient $$\binom{p}{2} = \frac{p(p-1)}{2}$$ is only an integral multiple of $$p$$ when $$p$$ is odd.

However, it can be shown that $$\nu_2(x^n-y^n) = \nu_2(x-y)+\nu_2(n)$$ when $$4 \mid x-y$$ by writing $$n = 2^ab$$ where $$a$$ and $$b$$ are integers with $$b$$ odd and noting that

\begin{align} \nu_2(x^n-y^n) &= \nu_2((x^{2^a})^b-(y^{2^a})^b) \\ &= \nu_2(x^{2^a}-y^{2^a}) \\ &= \nu_2((x^{2^{a-1}}+y^{2^{a-1}})(x^{2^{a-2}}+y^{2^{a-2}})\cdots(x^2+y^2)(x+y)(x-y)) \\ &= \nu_2(x-y)+a \end{align} $$ because since $$x \equiv y \equiv \pm 1 \pmod{4}$$, each factor in the difference of squares step in the form $$x^{2^k}+y^{2^k}$$ is congruent to 2 modulo 4.

The stronger statement $$\nu_2(x^n-y^n) = \nu_2(x-y)+\nu_2(x+y)+\nu_2(n)-1$$ when $$2 \mid x-y$$ is proven analogously.

Example problem
The LTE lemma can be used to solve 2020 AIME I #12: Let $$n$$ be the least positive integer for which $$149^n-2^n$$ is divisible by $$3^3\cdot5^5\cdot7^7.$$ Find the number of positive integer divisors of $$n$$. Solution. Note that $$149-2 = 147 = 3\cdot 7^2$$. Using the LTE lemma, since $$3 \nmid 149$$ and $$2$$ but $$3 \mid 147$$, $$\nu_3(149^n-2^n) = \nu_3(147)+\nu_3(n) = \nu_3(n)+1$$. Thus, $$3^3 \mid 149^n-2^n \iff 3^2 \mid n$$. Similarly, $$7 \nmid 149,2$$ but $$7 \mid 147$$, so $$\nu_7(149^n-2^n) = \nu_7(147)+\nu_7(n) = \nu_7(n)+2$$ and $$7^7 \mid 149^n-2^n \iff 7^5 \mid n$$.

Since $$5 \nmid 147$$, the factors of 5 are addressed by noticing that since the residues of $$149^n$$ modulo 5 follow the cycle $$4,1,4,1$$ and those of $$2^n$$ follow the cycle $$2,4,3,1$$, the residues of $$149^n-2^n$$ modulo 5 cycle through the sequence $$2,2,1,0$$. Thus, $$5 \mid 149^n-2^n$$ iff $$n = 4k$$ for some positive integer $$k$$. The LTE lemma can now be applied again: $$\nu_5(149^{4k}-2^{4k}) = \nu_5((149^4)^k-(2^4)^k) = \nu_5(149^4-2^4)+\nu_5(k)$$. Since $$149^4-2^4 \equiv (-1)^4-2^4 \equiv -15 \pmod{25}$$, $$\nu_5(149^4-2^4) = 1$$. Hence $$5^5 \mid 149^n-2^n \iff 5^4 \mid k \iff 4\cdot 5^4 \mid n$$.

Combining these three results, it is found that $$n = 2^2\cdot 3^2\cdot 5^4\cdot 7^5$$, which has $$(2+1)(2+1)(4+1)(5+1) = 270$$ positive divisors.