Number Theory
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 denotes . 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:
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 can only be , so 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 each of the two numbers is a perfect square (e.g. to prove that is not a square, use ).
- 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 (together with the lemma that " must have a prime factor ").
- Fermat numbers are pairwise coprime (by ), 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 and : Fermat's little theorem . Let denote the smallest positive integer such that ; then , and .
Signature killer move (handling ): take the smallest prime factor of and look at —it simultaneously divides and , while the smallest prime factor forces , forcing the order to be , a contradiction. Hence has only .
Wilson's theorem: prime (proved by "pairing elements with their inverses; only 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: . Modulo , squaring gives forcing , and after substitution we get , so is a smaller solution—contradiction, hence only the trivial solution exists. The same method proves irrational (descent for ).
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 are pairwise coprime, then the system of congruences has a solution, and it is unique modulo .
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 ": take distinct primes , solve , then is divisible by .
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.
Prove that an integer of the form cannot be written as the sum of two perfect squares.
Find all positive integers such that .
Ready to practise this topic?
Practise the available questions for this topic. Difficulty labels are platform references.
Practise Number Theory →