QiaoShen
← BMO Preparation details

Topic overview

Number theory is the most frequent topic in the SMC and BMO1, and BMO2 almost always has one question on it each year. The SMC part focuses on fast divisibility, congruence, last-digit and primality checks; proof questions require organising these facts into rigorous arguments. The five weapons you really need to train to the point of "reflex" are: **reduce possibilities by taking moduli**, **pigeonhole by residues/odd parts**, **orders and Fermat's little theorem**, **infinite descent**, and **construction via the Chinese Remainder Theorem (CRT)**. Master these and the vast majority of BMO number theory questions will have a clear direction to start from.

Key concepts

Recall that a≡b(modm)a\equiv b\pmod m denotes m∣a−bm\mid a-b. Congruence is closed under addition, subtraction and multiplication, so one can "replace everything with remainders and then calculate".

The most useful point is that the values of squares (and higher powers) are restricted modulo small numbers:

k2≡0,1 ( mod 4),k2≡0,1,4,7 ( mod 9),k2 mod 10∈{0,1,4,5,6,9}.k^2\equiv0,1\ (\bmod 4),\qquad k^2\equiv0,1,4,7\ (\bmod 9),\qquad k^2\bmod10\in\{0,1,4,5,6,9\}.

When proving that a number of a certain form does not have a certain property, first calculate the set of possible values of the target expression modulo some modulus; if the target falls outside the set, the proof is complete. For example, a sum of two squares modulo 44 can only be 0,1,20,1,2, so 4k+34k+3 is not a sum of two squares.

Key points

  • ◆To prove 'impossible', take moduli first: mod 4, mod 8 (odd squares ≡ 1), mod 9, mod 3 are the most commonly used
  • ◆Units/last two digits problems = mod 10 / mod 100; the last digit of a power is periodic (cyclic).
  • ◆Split into coprime factors, verify each separately, then recombine: $6=2\times3$, $24=8\times3$, $240=16\cdot3\cdot5$

Every positive integer is uniquely written as a product of prime powers (the Fundamental Theorem of Arithmetic). From this:

  • If the product of two coprime numbers is a perfect square, then ⇒\Rightarrow each of the two numbers is a perfect square (e.g. to prove that n(n+1)(n+2)=m3−mn(n+1)(n+2)=m^3-m is not a square, use gcd⁡(m,m2−1)=1\gcd(m,m^2-1)=1).
  • Use Euclid's method to prove that there are infinitely many primes: construct a number that "escapes the list" and take its new prime factor. By modifying the congruence class in which the constructed number lies, one can prove that there are infinitely many primes of type 4k+34k+3 (together with the lemma that "≡3(mod4)\equiv3\pmod4 must have a prime factor ≡3(mod4)\equiv3\pmod4").
  • Fermat numbers Fk=22k+1F_k=2^{2^k}+1 are pairwise coprime (by F0⋯Fk−1=Fk−2F_0\cdots F_{k-1}=F_k-2), which also gives that there are infinitely many primes.

Key points

  • ◆'There is no square number between adjacent square numbers' is a commonly used squeeze: when $m\ge2$, $m^2-1$ is not a square
  • ◆Construct a list of pairwise coprime numbers, taking a prime factor from each = manufacture infinitely many distinct primes
  • ◆$\gcd(a,b)\cdot\operatorname{lcm}(a,b)=ab$

For primes pp and p∤ap\nmid a: Fermat's little theorem ap−1≡1(modp)a^{p-1}\equiv1\pmod p. Let d=ord⁡p(a)d=\operatorname{ord}_p(a) denote the smallest positive integer such that ad≡1a^d\equiv1; then d∣p−1d\mid p-1, and an≡1  ⟺  d∣na^n\equiv1\iff d\mid n.

Signature killer move (handling n∣an±1n\mid a^n\pm1): take the smallest prime factor pp of nn and look at ord⁡p(a)\operatorname{ord}_p(a)—it simultaneously divides nn and p−1p-1, while the smallest prime factor forces gcd⁡(n,p−1)=1\gcd(n,p-1)=1, forcing the order to be 11, a contradiction. Hence n∣2n−1n\mid2^n-1 has only n=1n=1.

Wilson's theorem: pp prime   ⟺  (p−1)!≡−1(modp)\iff(p-1)!\equiv-1\pmod p (proved by "pairing elements with their inverses; only ±1\pm1 is self-inverse").

Key points

  • ◆The order must divide $p-1$ — this is the key to restricting the exponent
  • ◆"Least prime factor + order" is the general method for $n\mid a^n\pm1$-type questions
  • ◆$2^n-1$ is prime (Mersenne) $\Rightarrow n$ is prime ($2^a-1\mid2^{ab}-1$)

When proving that an equation has "no positive integer solutions": assume a solution exists, take the set that makes some variable minimal, then construct another set of the same type that is strictly smaller, contradiction (positive integers cannot descend infinitely). The engine is often congruence.

Typical: x2+y2=3z2x^2+y^2=3z^2. Modulo 3∈{0,1}3\in\{0,1\}, squaring gives x2+y2≡0x^2+y^2\equiv0 forcing 3∣x, 3∣y3\mid x,\ 3\mid y, and after substitution we get 3∣z3\mid z, so (x/3,y/3,z/3)(x/3,y/3,z/3) is a smaller solution—contradiction, hence only the trivial solution exists. The same method proves 3\sqrt3 irrational (descent for p2=3q2p^2=3q^2).

Key points

  • ◆On seeing coefficient $3z^2,5z^2$, first try modulo 3, modulo 5
  • ◆Descent = well-ordering principle: take a minimal solution to create a contradiction
  • ◆Complementary to the "rational root theorem": both are used for negative propositions such as "irrational/no solution"

If the moduli m1,…,mkm_1,\dots,m_k are pairwise coprime, then the system of congruences x≡ri(modmi)x\equiv r_i\pmod{m_i} has a solution, and it is unique modulo ∏mi\prod m_i.

CRT is a powerful tool for "constructing existence": if you want a string of numbers each satisfying a different divisibility requirement, assign a coprime modulus to each position. For example, to prove "there exist arbitrarily long runs of consecutive integers, each divisible by some square >1>1": take distinct primes p1,…,pnp_1,\dots,p_n, solve x≡−i(modpi2)x\equiv-i\pmod{p_i^2}, then x+ix+i is divisible by pi2p_i^2.

Key points

  • ◆Arbitrarily long runs of consecutive composite numbers / squareful / non-powers—all constructed via CRT
  • ◆The moduli must be pairwise coprime before they can be combined
  • ◆Supplementary weapons: $p$-adic valuation $v_p$ (to prove $H_n=1+\tfrac12+\cdots+\tfrac1n$ is not an integer, focus on the largest power of 2); conjugate adjoint $(a+\sqrt b)^n+(a-\sqrt b)^n$ (to prove rounding/divisibility)

Worked examples

Try each example yourself before checking the explanation.

1Example 1: mod 4 test — $4k+3$ is not a sum of two squares

Prove that an integer of the form 4k+34k+3 cannot be written as the sum of two perfect squares.

2Example 2: least prime factor + order — find all $n\mid 2^n-1$

Find all positive integers nn such that n∣2n−1n\mid 2^n-1.

Ready to practise this topic?

Practise the available questions for this topic. Difficulty labels are platform references.

Practise Number Theory →