Library · Between the Challenge and the Olympiad · Chapter 1

Tools this book assumes

Revised Report an error
On this page
  1. Conventions and a few words
  2. Congruences
  3. The Euclidean algorithm
  4. Proof by induction
  5. The pigeonhole principle
  6. Inclusion and exclusion
  7. The arithmetic and geometric means
  8. Geometry the A-level course leaves out
  9. What is not here

An A-level course teaches a great deal that this book uses without comment: algebra, the circle theorems, similar triangles, the sine and cosine rules, permutations and combinations, the binomial theorem. It also leaves out a handful of things that competition problems lean on constantly. This chapter supplies those, and nothing else. Each one arrives through a problem it cracks, because a tool met while it is doing something is a tool you still have next month.

Read it once now, quickly, and come back when a solution points here. Everything the book needs beyond this chapter is proved where it is used.

Conventions and a few words

The natural numbers in this book are 1,2,3,…1, 2, 3, \ldots, and zero is not among them. Where a problem means to include zero it says so.

The greatest common divisor of aa and bb, written gcd⁡(a,b)\gcd(a,b), is what school called the highest common factor. The competition literature says gcd almost without exception, so that is what is used here. Similarly lcm⁡(a,b)\operatorname{lcm}(a,b) is the lowest common multiple.

Two numbers are coprime when their only common factor is 11, so 99 and 1414 are coprime while 99 and 1515 are not. The word does a lot of work in number theory problems, since a condition that two quantities share no factor is usually the hinge the problem turns on.

A lemma is a result proved on the way to something else, worth stating on its own because the main argument reads better once it is out of the way.

Congruences

A problem to start

What is the remainder when 71007^{100} is divided by 55?

Nobody wants to compute 71007^{100}. Notice instead that 77 leaves remainder 22 on division by 55, and that remainders behave well under multiplication: if 77 behaves like 22, then 71007^{100} behaves like 21002^{100}. Now 24=162^4 = 16 leaves remainder 11, so 2100=(24)25behaves like125=1.2^{100} = \left(2^4\right)^{25} \quad\text{behaves like}\quad 1^{25} = 1 . The remainder is 11.

The notation

That argument is worth a language of its own. Write a≡b(modn)a \equiv b \pmod{n} to mean that aa and bb leave the same remainder on division by nn, equivalently that nn divides a−ba - b. Read it as “aa is congruent to bb modulo nn”. So 7≡2(mod5)7 \equiv 2 \pmod 5, and 17≡5≡−1(mod6)17 \equiv 5 \equiv -1 \pmod 6. Negative representatives are allowed and are often the convenient ones.

The three rules

If a≡b(modn)a \equiv b \pmod n and c≡d(modn)c \equiv d \pmod n, then a+c≡b+d,a−c≡b−d,ac≡bd(modn).a + c \equiv b + d, \qquad a - c \equiv b - d, \qquad ac \equiv bd \pmod{n} . Each follows from the definition in one line. For the last, write a=b+kna = b + kn and c=d+lnc = d + ln; then ac=bd+n(bl+dk+kln)ac = bd + n(bl + dk + kln), which differs from bdbd by a multiple of nn. Multiplying a congruence by itself repeatedly gives the fourth rule, the one that did the work above: if a≡b(modn)a \equiv b \pmod n then am≡bm(modn)a^m \equiv b^m \pmod n for every positive integer mm.

Where it goes wrong

You may not divide. From 2×3≡2×8(mod10)2 \times 3 \equiv 2 \times 8 \pmod{10}, which says 6≡166 \equiv 16, it does not follow that 3≡8(mod10)3 \equiv 8 \pmod{10}. Cancelling a factor kk is legitimate only when gcd⁡(k,n)=1\gcd(k, n) = 1, and then it is legitimate always. Keep that condition in view: a large share of wrong solutions to number theory problems are a division nobody checked.

A second problem

What are the last two digits of 720267^{2026}?

The last two digits of a number are its remainder modulo 100100, so this asks for 720267^{2026} modulo 100100. Compute the small powers: 72=497^2 = 49, and 74=492=2401≡1(mod100)7^4 = 49^2 = 2401 \equiv 1 \pmod{100}. That 11 is the whole solution. Since 2026=4×506+22026 = 4 \times 506 + 2, 72026=(74)506×72≡1506×49=49(mod100).7^{2026} = \left(7^4\right)^{506} \times 7^2 \equiv 1^{506} \times 49 = 49 \pmod{100} . The last two digits are 4949. The shape recurs throughout the book: find the smallest power that comes back to 11, then reduce the exponent modulo that.

Fermat’s little theorem

Sometimes the exponent that returns to 11 can be named in advance. If pp is prime and pp does not divide aa, then ap−1≡1(modp).a^{p-1} \equiv 1 \pmod{p} . Here is why. Consider the p−1p-1 numbers a,2a,3a,…,(p−1)aa, 2a, 3a, \ldots, (p-1)a modulo pp. No two of them are congruent, since ia≡jaia \equiv ja would give p∣a(i−j)p \mid a(i-j), and pp divides neither aa nor the difference i−ji - j, which lies strictly between −p-p and pp. None of them is 00 modulo pp for the same reason. So they are the numbers 1,2,…,p−11, 2, \ldots, p-1 in some order, and multiplying them together, ap−1×(p−1)!≡(p−1)!(modp).a^{p-1} \times (p-1)! \equiv (p-1)! \pmod p . Every factor of (p−1)!(p-1)! is coprime to pp, so it may be cancelled, which leaves the theorem.

For example, the remainder of 31003^{100} modulo 77: the theorem gives 36≡13^6 \equiv 1, and 100=6×16+4100 = 6 \times 16 + 4, so 3100≡34=81≡4(mod7)3^{100} \equiv 3^4 = 81 \equiv 4 \pmod 7.

The Euclidean algorithm

A problem to start

Find gcd⁡(1071,462)\gcd(1071, 462) without factorising either number.

Any common divisor of 10711071 and 462462 divides their difference, and more usefully divides 1071−2×462=1471071 - 2 \times 462 = 147. So the pair (1071,462)(1071, 462) and the pair (462,147)(462, 147) have exactly the same common divisors, and the second pair is the smaller. Repeat: 1071=2×462+147,462=3×147+21,147=7×21+0.1071 = 2 \times 462 + 147, \qquad 462 = 3 \times 147 + 21, \qquad 147 = 7 \times 21 + 0 . The last non-zero remainder is 2121, and gcd⁡(1071,462)=21\gcd(1071, 462) = 21.

The tool

Replacing (a,b)(a, b) by (b,r)(b, r), where rr is the remainder of aa on division by bb, preserves the set of common divisors and strictly decreases the numbers, so the process stops. The last non-zero remainder is the greatest common divisor. It is fast: the numbers roughly halve every two steps, so even four-digit numbers take a handful of lines.

Running it backwards

Read the same equations upwards and each remainder becomes a combination of the two original numbers: 21=462−3×147=462−3(1071−2×462)=7×462−3×1071.21 = 462 - 3 \times 147 = 462 - 3\left(1071 - 2 \times 462\right) = 7 \times 462 - 3 \times 1071 . This always works, and it proves something the book uses repeatedly: for any aa and bb there are integers xx and yy with ax+by=gcd⁡(a,b),ax + by = \gcd(a, b) , and in particular ax+by=1ax + by = 1 can be solved exactly when aa and bb are coprime. One consequence deserves its own line, since it is the reason primes matter: if a prime pp divides abab then it divides aa or it divides bb.

Proof by induction

A problem to start

Show that 13+23+⋯+n3=(12n(n+1))21^3 + 2^3 + \cdots + n^3 = \left(\tfrac{1}{2}n(n+1)\right)^2 for every natural number nn.

Check n=1n = 1: the left side is 11 and the right side is 11. Now suppose the formula holds for some particular nn, and add the next cube: (12n(n+1))2+(n+1)3=(n+1)2(n24+n+1)=(n+1)2×n2+4n+44=(12(n+1)(n+2))2,\begin{align*} \left(\tfrac{1}{2}n(n+1)\right)^2 + (n+1)^3 &= (n+1)^2\left(\frac{n^2}{4} + n + 1\right) \\ &= (n+1)^2 \times \frac{n^2 + 4n + 4}{4} \\ &= \left(\tfrac{1}{2}(n+1)(n+2)\right)^2 , \end{align*} which is the formula for n+1n+1. Since it holds at 11, it holds at 22, and so on through every natural number.

The tool

To prove a statement P(n)P(n) for all n≥n0n \geq n_0, prove P(n0)P(n_0) and prove that P(n)P(n) implies P(n+1)P(n+1). Both halves are needed. The first is not a formality: plenty of false statements survive the second test and fail the first.

A variant appears often here. Strong induction assumes P(k)P(k) for every kk below nn rather than for n−1n-1 alone, and is what you want when the step reaches back several places, as it does whenever a problem splits a number into two smaller ones.

The pigeonhole principle

A problem to start

Fifty-one numbers are chosen from 11 to 100100. Show that two of them are coprime.

Pair the numbers off as (1,2),(3,4),(5,6),…,(99,100)(1,2), (3,4), (5,6), \ldots, (99,100), which is fifty pairs. Fifty-one chosen numbers cannot avoid putting two into the same pair, and two numbers in the same pair are consecutive. Consecutive numbers differ by 11, so any common divisor divides 11, and they are coprime.

The tool

If nn objects go into kk boxes and n>kn > k, some box holds at least two. More is true and is used just as often: some box holds at least ⌈n/k⌉\lceil n/k \rceil objects, since if every box held fewer there would be fewer than nn objects in total.

The principle is trivial. The work is always in choosing the boxes, and that choice is the crux of every problem that uses it.

Inclusion and exclusion

A problem to start

How many of the numbers 11 to 100100 are divisible by 22, by 33 or by 55?

There are 5050 multiples of 22, 3333 of 33 and 2020 of 55. Adding those counts every multiple of 66, of 1010 and of 1515 twice, so subtract 1616, 1010 and 66. That subtraction has now removed the multiples of 3030 three times having added them three times, so add the 33 of them back: 50+33+20−16−10−6+3=74.50 + 33 + 20 - 16 - 10 - 6 + 3 = 74 .

The tool

For two sets, ∣A∪B∣=∣A∣+∣B∣−∣A∩B∣|A \cup B| = |A| + |B| - |A \cap B|. For three, ∣A∪B∪C∣=∣A∣+∣B∣+∣C∣−∣A∩B∣−∣B∩C∣−∣C∩A∣+∣A∩B∩C∣.|A \cup B \cup C| = |A| + |B| + |C| - |A \cap B| - |B \cap C| - |C \cap A| + |A \cap B \cap C| . In general, add the sizes of the sets, subtract the sizes of all pairwise intersections, add back the triples, and continue with alternating signs. The reason is a count from the point of view of one object: an object in exactly mm of the sets is counted mm times, then removed (m2)\binom{m}{2} times, then restored (m3)\binom{m}{3} times, and the alternating sum (m1)−(m2)+⋯\binom{m}{1} - \binom{m}{2} + \cdots equals 11 for every m≥1m \geq 1.

The arithmetic and geometric means

A problem to start

A rectangle has perimeter 4040. How large can its area be?

Let the sides be aa and bb with a+b=20a + b = 20. Then ab=(a+b2)2−(a−b2)2=100−(a−b2)2,ab = \left(\frac{a+b}{2}\right)^2 - \left(\frac{a-b}{2}\right)^2 = 100 - \left(\frac{a-b}{2}\right)^2 , which is largest when a=ba = b, giving area 100100. No calculus was needed, and the answer came with its equality case attached.

The tool

For non-negative aa and bb, a+b2≥ab,\frac{a+b}{2} \geq \sqrt{ab} , with equality exactly when a=ba = b. This is (a−b)2≥0\left(\sqrt a - \sqrt b\right)^2 \geq 0 rearranged. For three non-negative numbers, a+b+c3≥abc3,\frac{a+b+c}{3} \geq \sqrt[3]{abc} , with equality exactly when a=b=ca = b = c. Writing a=x3a = x^3, b=y3b = y^3, c=z3c = z^3, this is the identity x3+y3+z3−3xyz=(x+y+z)(x2+y2+z2−xy−yz−zx)x^3 + y^3 + z^3 - 3xyz = (x+y+z)\left(x^2 + y^2 + z^2 - xy - yz - zx\right) together with the observation that the second bracket equals 12((x−y)2+(y−z)2+(z−x)2)\tfrac{1}{2}\left((x-y)^2 + (y-z)^2 + (z-x)^2\right) and so is never negative.

Use it in the direction that helps: a sum bounded below by a product when the product is fixed, a product bounded above by a sum when the sum is fixed. The equality case is half the tool, since it tells you where the extreme configuration sits.

Geometry the A-level course leaves out

An A-level course does geometry with coordinates, vectors and trigonometry, and leaves the synthetic subject at GCSE. Four things from that older tradition are needed here, and each is a short argument from what school already gave you.

Three centres and a word

The incentre of a triangle is where its three angle bisectors meet, and it is the centre of the circle that touches all three sides. The circumcentre is where the perpendicular bisectors of the sides meet, and it is the centre of the circle through all three vertices. The orthocentre is where the three altitudes meet. Each of those three claims is that three lines pass through one point, and each is proved where the book first needs it.

Four or more points are concyclic when a single circle passes through all of them. Showing that four points are concyclic is one of the most useful moves in the subject, because it puts the circle theorems at your disposal: opposite angles of the quadrilateral then add to 180180 degrees, and angles standing on the same chord from the same side are equal.

Similar triangles, the workhorse

Two triangles with equal angles have proportional sides. Almost every synthetic solution in this book is a hunt for a pair of similar triangles, and the usual way to find one is an angle chase: equal angles in the same segment, angles in a cyclic quadrilateral, the alternate segment theorem, or a pair of parallel lines.

The angle bisector theorem

In triangle ABCABC, let the bisector of the angle at AA meet BCBC at DD. Then BDDC=ABAC.\frac{BD}{DC} = \frac{AB}{AC} . Compare the two triangles ABDABD and ACDACD. They have the same height from AA, so their areas are in the ratio BD:DCBD : DC. Using the formula 12pqsin⁡θ\tfrac12 pq \sin \theta on the angle at AA, which the bisector splits into two equal halves, their areas are also in the ratio AB:ACAB : AC. The two ratios are equal.

The power of a point

Let a line through PP meet a circle at AA and BB, and another line through PP meet it at CC and DD. Then PA×PB=PC×PD.PA \times PB = PC \times PD . When PP is inside the circle, triangles PACPAC and PDBPDB have equal angles at PP, being vertically opposite, and equal angles at AA and DD, being angles in the same segment on BCBC. So they are similar and PA/PD=PC/PBPA/PD = PC/PB, which rearranges to the claim. When PP is outside, the same pair of triangles is similar for the same reasons, with the angle at PP now shared rather than vertically opposite.

The tangent case is the one to remember: if PTPT touches the circle at TT, then PT2=PA×PB,PT^2 = PA \times PB , which follows by the alternate segment theorem in place of the angles in the same segment. The common value is called the power of PP, and a problem that mentions two circles and a point is very often asking about it.

Ptolemy’s theorem

For a cyclic quadrilateral ABCDABCD, AC×BD=AB×CD+BC×DA.AC \times BD = AB \times CD + BC \times DA . It is used twice in this book and proved at its first use, since the construction that proves it is worth seeing where it is doing work rather than here.

What is not here

Everything else. Where a solution needs a result this chapter has not given, it proves the case it needs on the spot, and where a solution needs an idea rather than a result, the crux at its head names the idea before the computation starts. Nothing in the book asks you to accept a theorem you have not seen justified, and nothing in it uses calculus.

Report an error on this page

Reports are stored by Netlify. See the privacy note.