Official IMO Representative for Nepal
Back to Blog
number_theoryAugust 20, 202612 min read

Elementary Number Theory in Mathematical Olympiads: From Modular Arithmetic to Lifting the Exponent

A structured guide to core and advanced number theory techniques for mathematical competitions, covering divisibility, modular arithmetic, Euler's totient theorem, and the Lifting the Exponent Lemma (LTE) with worked examples.

P
Prajit Adhikari
IMO Trainer, IMO 2018, 2019 Participant.

Number theory is one of the four standard pillars of mathematical olympiad competitions, alongside algebra, combinatorics, and geometry. Unlike calculus or analysis, elementary number theory focuses strictly on the properties of integers. Problems frequently have deceptively brief statements, yet solving them demands structural insight, careful modular reductions, and prime valuation techniques. This article presents the core theorems and practical tools needed to tackle contest problems, concluding with the Lifting the Exponent Lemma (LTE).

1. Divisibility and Prime Factorization

Given two integers aa and bb with a≠0a \ne 0, we say that aa divides bb (written a∣ba \mid b) if there exists an integer kk such that b=k⋅ab = k \cdot a. When aa does not divide bb, we write a∤ba \nmid b. Every integer divisibility argument rests on two classical results:

gcd⁡(a,b)=d  ⟹  ∃,x,y∈Zsuch thatax+by=d\gcd(a, b) = d \implies \exists \\, x, y \in \mathbb{Z} \quad \text{such that} \quad ax + by = d
Bézout's Identity: gcd(a, b) as a linear combination

The second foundational result is the Fundamental Theorem of Arithmetic: every integer n≥2n \ge 2 can be written uniquely (up to the order of factors) as a product of prime numbers:

n=p1α1p2α2⋯pkαk(pi distinct primes,,αi≥1)n = p_1^{\alpha_1} p_2^{\alpha_2} \cdots p_k^{\alpha_k} \quad (p_i \text{ distinct primes}, \\, \alpha_i \ge 1)
Fundamental Theorem of Arithmetic

This canonical factorization introduces the pp-adic valuation notation: for a prime pp and positive integer nn, vp(n)v_p(n) denotes the exponent of the highest power of pp dividing nn. In other words, vp(n)=αv_p(n) = \alpha if pα∣np^\alpha \mid n and pα+1∤np^{\alpha+1} \nmid n. Valuations satisfy two practical rules: vp(ab)=vp(a)+vp(b)v_p(ab) = v_p(a) + v_p(b), and vp(a+b)≥min⁡(vp(a),vp(b))v_p(a + b) \ge \min(v_p(a), v_p(b)), with equality whenever vp(a)≠vp(b)v_p(a) \ne v_p(b).

2. Modular Arithmetic and Residue Systems

Modular arithmetic formalizes the arithmetic of remainders. We write a≡b(modm)a \equiv b \pmod{m} if m∣(a−b)m \mid (a - b). Congruence modulo mm defines an equivalence relation that respects addition, subtraction, and multiplication. If a≡b(modm)a \equiv b \pmod{m} and c≡d(modm)c \equiv d \pmod{m}, then a+c≡b+d(modm)a + c \equiv b + d \pmod{m} and ac≡bd(modm)ac \equiv bd \pmod{m}. However, division requires caution:

ca≡cb(modm)  ⟺  a≡b(modmgcd⁡(c,m))ca \equiv cb \pmod{m} \iff a \equiv b \pmod{\frac{m}{\gcd(c, m)}}
Division Rule in Modular Congruences

In particular, if gcd⁡(c,m)=1\gcd(c, m) = 1, we can divide both sides of a congruence by cc without altering the modulus. When working with prime moduli, every non-zero residue has a unique multiplicative inverse.

3. Fermat's Little Theorem and Euler's Totient Theorem

Fermat's Little Theorem characterizes the periodic nature of powers modulo a prime number pp:

ap≡a(modp)andap−1≡1(modp)for p∤aa^p \equiv a \pmod{p} \quad \text{and} \quad a^{p-1} \equiv 1 \pmod{p} \quad \text{for } p \nmid a
Fermat's Little Theorem

Euler generalized this to an arbitrary positive modulus nn through the Euler totient function ϕ(n)\phi(n), which counts how many integers in 1,2,…,n\\{1, 2, \ldots, n\\} are coprime to nn. If nn has prime factorization n=p1α1⋯pkαkn = p_1^{\alpha_1} \cdots p_k^{\alpha_k}, the totient is calculated as:

ϕ(n)=n∏p∣n(1−1p)=∏i=1kpiαi−1(pi−1)\phi(n) = n \prod_{p \mid n} \left(1 - \frac{1}{p}\right) = \prod_{i=1}^k p_i^{\alpha_i - 1}(p_i - 1)
Euler's Totient Function Formula

Euler's theorem states that for any integer aa coprime to nn:

aϕ(n)≡1(modn)whenever gcd⁡(a,n)=1a^{\phi(n)} \equiv 1 \pmod{n} \quad \text{whenever } \gcd(a, n) = 1
Euler's Totient Theorem
Problem-Solving Strategy: Congruence Obstructions

When trying to show an integer equation has no solutions, test small moduli such as 33, 44, 77, 88, or 99. For example, squares can only be 00 or 1(mod3)1 \pmod 3 and (mod4)\pmod 4, and 0,1,4,0, 1, 4, or 7(mod8)7 \pmod 8. Cubes can only be 0,1,0, 1, or 8(mod9)8 \pmod 9. These constraints frequently rule out infinite families of candidates immediately.

4. The Order of an Element Modulo n

Let gcd⁡(a,n)=1\gcd(a, n) = 1. The order of aa modulo nn, denoted ordn(a)\text{ord}_n(a), is defined as the smallest positive integer dd such that ad≡1(modn)a^d \equiv 1 \pmod{n}. The concept of order has two critical properties that frequently unlock competition problems:

  • If ak≡1(modn)a^k \equiv 1 \pmod{n} for some positive integer kk, then ordn(a)\text{ord}_n(a) must divide kk.
  • Because aϕ(n)≡1(modn)a^{\phi(n)} \equiv 1 \pmod{n} by Euler's theorem, we always have ordn(a)∣ϕ(n)\text{ord}_n(a) \mid \phi(n). If the modulus is prime pp, then ordp(a)∣(p−1)\text{ord}_p(a) \mid (p - 1).

5. The Lifting the Exponent Lemma (LTE)

Exponential Diophantine equations often feature differences or sums of powers of the form xn−ynx^n - y^n or xn+ynx^n + y^n. The Lifting the Exponent Lemma (LTE) provides an exact equation for the pp-adic valuation of such expressions. It is one of the most powerful tools in modern olympiad number theory.

LTE for Odd Primes: The Main Case

Let pp be an odd prime. Let xx and yy be integers such that p∣(x−y)p \mid (x - y), but p∤xp \nmid x and p∤yp \nmid y. Then for any positive integer nn:

vp(xn−yn)=vp(x−y)+vp(n)v_p(x^n - y^n) = v_p(x - y) + v_p(n)
Lifting the Exponent Lemma (Odd prime p, minus case)

When nn is an odd positive integer and p∣(x+y)p \mid (x + y) with p∤xp \nmid x and p∤yp \nmid y, substituting −y-y into the formula yields the plus case:

vp(xn+yn)=vp(x+y)+vp(n)v_p(x^n + y^n) = v_p(x + y) + v_p(n)
Lifting the Exponent Lemma (Odd prime p, odd n, plus case)

LTE for the Prime p = 2

The prime 22 requires special care because the parity of nn affects whether intermediate terms are divisible by 44. Let xx and yy be odd integers such that 4∣(x−y)4 \mid (x - y). Then for any positive integer nn:

v2(xn−yn)=v2(x−y)+v2(n)v_2(x^n - y^n) = v_2(x - y) + v_2(n)
LTE for p = 2 when 4 | (x - y)

If 2∣(x−y)2 \mid (x - y) but 44 does not divide (x−y)(x - y), then 4∣(x+y)4 \mid (x + y). For even nn, the formula takes the general form:

v2(xn−yn)=v2(x−y)+v2(x+y)+v2(n)−1v_2(x^n - y^n) = v_2(x - y) + v_2(x + y) + v_2(n) - 1
General LTE for p = 2 with even n
Prerequisite Checklist for LTE

Before using LTE in an exam, always state the conditions explicitly: verify that pp is a prime, check that p∣(x−y)p \mid (x - y), verify that p∤xp \nmid x and p∤yp \nmid y, and pay attention to whether nn is even or odd when handling p=2p = 2. Writing out these checks prevents point deductions.

6. Worked Olympiad Example Problem

Problem: Find all positive integers nn such that 3n−13^n - 1 is divisible by 220262^{2026}.

Step 1: Reformulate in terms of 22-adic valuation. The condition that 220262^{2026} divides 3n−13^n - 1 translates to:

v2(3n−1)≥2026v_2(3^n - 1) \ge 2026
Valuation Condition

Step 2: Check the parity of nn. If nn were odd, then 3n≡3≡(−1)n≡−1≡3(mod4)3^n \equiv 3 \equiv (-1)^n \equiv -1 \equiv 3 \pmod 4, which means 3n−1≡2(mod4)3^n - 1 \equiv 2 \pmod 4. Consequently, v2(3n−1)=1v_2(3^n - 1) = 1 for any odd nn. Since 1<20261 < 2026, no odd integer nn satisfies the condition. Therefore, nn must be even.

Step 3: Apply the even-nn LTE formula for p=2p = 2 with x=3x = 3 and y=1y = 1. Both xx and yy are odd integers, and nn is even:

v2(3n−1)=v2(3−1)+v2(3+1)+v2(n)−1=v2(2)+v2(4)+v2(n)−1=1+2+v2(n)−1=v2(n)+2v_2(3^n - 1) = v_2(3 - 1) + v_2(3 + 1) + v_2(n) - 1 = v_2(2) + v_2(4) + v_2(n) - 1 = 1 + 2 + v_2(n) - 1 = v_2(n) + 2
LTE Calculation

Step 4: Substitute the result back into the inequality:

v2(n)+2≥2026  ⟺  v2(n)≥2024  ⟺  22024∣nv_2(n) + 2 \ge 2026 \iff v_2(n) \ge 2024 \iff 2^{2024} \mid n
Solving for n

Conclusion: The solutions are all positive integers of the form n=k⋅22024n = k \cdot 2^{2024}, where kk is an arbitrary positive integer. Notice how LTE turned an exponential Diophantine divisibility problem into a straightforward linear valuation equation.

Summary for Competition Practice

To develop proficiency in contest number theory, begin by examining small residue classes when analyzing equations. Use modular constraints to eliminate impossible cases, investigate multiplicative orders to understand powers, and apply valuation formulas like LTE when managing varying exponents. Approaching integer problems with these systematic steps builds the precision and confidence required at the national and international olympiad level.

Number TheoryLTE LemmaModular ArithmeticOlympiad