Maths WorkshopMaths problems with full solutions
Exercise 1962Number theory › PrimesOlympiadAdded 4 Nov 2026

The exact power of 3 dividing 2^(3ⁿ) + 1

#p-adic valuation#lifting the exponent#induction

Statement

Let v3(m)v_3(m) denote the exponent of 33 in the prime factorisation of mm. Prove that for every n≥0n\ge0,
v3(23n+1)=n+1.v_3\left(2^{3^n}+1\right)=n+1.

Hint

Put xn=23nx_n=2^{3^n}, so xn+1=xn3x_{n+1}=x_n^3, and factor x3+1=(x+1)(x2−x+1)x^3+1=(x+1)(x^2-x+1). What is x2−x+1x^2-x+1 modulo 99 when x≡−1(mod3)x\equiv-1\pmod3?

Show solutionHide solution

Solution

Idea. Each cube multiplies the number x+1x+1 by a factor having valuation exactly 11.

Lemma. If x≡−1(mod3)x\equiv-1\pmod3, then v3(x2−x+1)=1v_3(x^2-x+1)=1. Indeed write x=3t−1x=3t-1: then
x2−x+1=9t2−6t+1−3t+1+1=9t2−9t+3≡3(mod9),x^2-x+1=9t^2-6t+1-3t+1+1=9t^2-9t+3\equiv3\pmod9,
so 3∣x2−x+13\mid x^2-x+1 but 9∤x2−x+19\nmid x^2-x+1.

Induction. Let xn=23nx_n=2^{3^n}. As 3n3^n is odd, xn≡(−1)3n=−1(mod3)x_n\equiv(-1)^{3^n}=-1\pmod3, so the lemma applies to xnx_n.
- n=0n=0: x0+1=3x_0+1=3, so v3=1v_3=1.
- Step: xn+1+1=xn3+1=(xn+1)(xn2−xn+1)x_{n+1}+1=x_n^3+1=(x_n+1)(x_n^2-x_n+1), so
v3(xn+1+1)=v3(xn+1)+1.v_3(x_{n+1}+1)=v_3(x_n+1)+1.

Hence v3(xn+1)=n+1v_3(x_n+1)=n+1.

Check. 23+1=92^3+1=9 (v3=2v_3=2), 29+1=513=27⋅192^9+1=513=27\cdot19 (v3=3v_3=3), 227+1=134217729=81⋅16570092^{27}+1=134217729=81\cdot1657009 (v3=4v_3=4).

Remark. This is the special case of the *Lifting The Exponent lemma*: for an odd prime pp with p∣a−bp\mid a-b, p∤abp\nmid ab: vp(an−bn)=vp(a−b)+vp(n)v_p(a^n-b^n)=v_p(a-b)+v_p(n).

Lesson. To compute an exact pp-adic valuation, factor with the cyclotomic identity (xp−ypx^p-y^p or xp+ypx^p+y^p) and track how the valuation grows at each step.