math notes

152
A Toolchest of Mathematics Notes for Mathematical Olympiads July 2014

Upload: kaushik247

Post on 01-Sep-2015

296 views

Category:

Documents


12 download

DESCRIPTION

A toolchest of mathematical notes

TRANSCRIPT

  • A Toolchest of Mathematics Notes

    for Mathematical Olympiads

    July 2014

  • 2Teaching to solve problems is education of the will. Solving problems which are nottoo easy for him, the student learns to persevere through unsuccess, to appreciatesmall advances, to wait for the essential idea, to concentrate with all his might whenit appears. If the student had no opportunity in school to familiarize himself withthe varying emotions of the struggle for the solution his mathematical educationfailed in the most vital point.

    George PolyaHow To Solve It

  • Contents

    1 Sets and Logic 71.1 Sets and membership . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71.2 Specifying sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71.3 Special sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81.4 Variants of set-builder notation . . . . . . . . . . . . . . . . . . . . . . . . . . . 81.5 Subsets and supersets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81.6 Universal sets and complements . . . . . . . . . . . . . . . . . . . . . . . . . . . 81.7 Unions, intersections, and relative complements . . . . . . . . . . . . . . . . . . 91.8 De Morgans Laws . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91.9 Symbols Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101.10 The connection between Set Theory and Logic . . . . . . . . . . . . . . . . . . . 101.11 Logic with Quantifiers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11Exercise Set 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

    2 Proof Techniques 132.1 Propositions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132.2 Direct Proofs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132.3 Proof by Contraposition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142.4 Proof by Contradiction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142.5 Identities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152.6 Proof by Mathematical Induction . . . . . . . . . . . . . . . . . . . . . . . . . . 162.7 Example of a Direct Proof . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172.8 Example of a Proof by Contradiction . . . . . . . . . . . . . . . . . . . . . . . . 18Exercise Set 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

    3 Mathematical Induction 19Exercise Set 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

    4 Algebra: Quadratic polynomials and Vie`tes Theorem 254.1 Polynomials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254.2 Quadratic polynomials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274.3 Horners Method and Synthetic Division . . . . . . . . . . . . . . . . . . . . . . 29Exercise Set 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30

    5 Factorisation Background 31Exercise Set 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

    6 Number Theory introduction 376.1 Divisibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

    6.1.1 Summary of divisibility terms . . . . . . . . . . . . . . . . . . . . . . . . 376.2 Prime numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

    6.2.1 Sieve of Eratosthenes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39Exercise Set 6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

    3

  • 4 CONTENTS

    7 Number Theory divisors and multiples 43Exercise Set 7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

    8 Number Theory congruences 53Exercise Set 8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56

    9 Number Theory cryptosystems 59Exercise Set 9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63

    10 The Pigeon-Hole Principle 65Exercise Set 10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67

    11 Summation and Product Notation 69Exercise Set 11 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78

    12 Algebra: Inequalities 7912.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7912.2 Symbols and Elementary Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . 7912.3 Absolute values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8112.4 Triangle Inequality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8212.5 Squares are never negative . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8212.6 Arithmetic, Geometric and Harmonic Means . . . . . . . . . . . . . . . . . . . . 8312.7 The Cauchy-Schwarz Inequality . . . . . . . . . . . . . . . . . . . . . . . . . . . 8412.8 Rearrangements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8612.9 Optimisation applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8712.10Generalising AM-GM-HM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8812.11The Chebyshev Inequality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8912.12Theres more than one way! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90Exercise Set 12 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93

    13 Plane Geometry 9913.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9913.2 Lines and angles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9913.3 Congruence of triangles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9913.4 Parallel lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10213.5 Similarity of triangles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10213.6 More triangle theorems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10213.7 Angles of a convex polygon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10313.8 Quadrilaterals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10313.9 Special Triangle Theorems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10313.10Areas and perimeters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10413.11Circles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10413.12Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10813.13Cevas Theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11113.14The Euler Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11213.15The Nine-point Circle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11213.16The Radical Axis of Two Circles . . . . . . . . . . . . . . . . . . . . . . . . . . . 112

  • CONTENTS 5

    13.17The Power of a Point . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112Exercise Set 13 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115

    14 Vectors 12114.1 Introduction and notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12114.2 Vector addition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12214.3 Scalar multiplication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12214.4 Length of a vector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12314.5 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12414.6 Special vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12414.7 The scalar product or dot product . . . . . . . . . . . . . . . . . . . . . . . . . . 126

    14.7.1 Properties of the dot product . . . . . . . . . . . . . . . . . . . . . . . . 12614.7.2 Further properties of the dot product . . . . . . . . . . . . . . . . . . . . 126

    15 Analysis 12715.1 Real Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12715.2 Real Number Laws. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12815.3 Properties of a field F . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12915.4 Absolute Value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13015.5 Subsets of the Real Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13015.6 Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13115.7 Inverse functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13315.8 Indices and Logarithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13515.9 Limits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13715.10Limits at Infinity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13815.11Continuous Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13915.12Bolzanos Theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14015.13Intermediate Value Theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14015.14Extreme Value Theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14015.15Sequences and Series . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14115.16Comparison Tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14315.17The Ratio Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14315.18Functional Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144Exercise Set 15 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148

    Index 149

  • 6 CONTENTS

  • CHAPTER 1

    Sets and Logic

    In this chapter, we establish the notation and fundamental notions of sets, and discuss thecorrespondence of sets with logic.

    1.1 Sets and membership

    A set is a collection of objects. These objects are called the elements or members of the set,where the objects can be anything: numbers, people, other sets, etc. E.g., 12 is an element ofthe set of even integers.

    If x is an element of A, then it is also said that x belongs to A, or that x is in A. or that Acontains x. In this case, we write x A. The symbol was first used by Peano in 1888, and isderived from the Greek letter epsilon (the letter in the Greek alphabet corresponding to theRoman letter e which is of course the initial letter of element); introduced by Peano in 1888.We may also say A contains x, and write A 3 x. If x is not in A, we write: x / A.

    1.2 Specifying sets

    The simplest way to describe a set is by enumeration, i.e. by listing its elements explicitlybetween curly braces. Thus {1, 2} denotes the set whose only elements are 1 and 2. Note thefollowing two properties of sets:

    Order of elements is immaterial, e.g. {1, 2} = {2, 1}.

    Repetition (multiplicity) of elements is irrelevant, e.g. {1, 1, 2, 2} = {1, 2, 2, 2} = {1, 2}.

    A set can have no elements. In this case we say the set is empty and denote the empty set by{}. We also use the term null set and the notation for the empty set.

    The alternative way to represent a set is with set-builder notation, which has the form

    {pattern | condition(s)}.

    Typically, we write {x | P (x)}, or {x : P (x)}, to denote the set containing all objects x suchthat the condition or property P holds. E.g. we may write

    {x | x is a prime},

    literally read as:

    the set of all x such that x is a prime,

    which, in this case, we could say more succinctly as: the set of prime numbers. Usually, weread the symbol | as such that. The pattern may also be an expression, e.g.

    {p2 | p is a prime}

    is the set of all numbers that are the squares of prime numbers.

    7

  • 8 CHAPTER 1. SETS AND LOGIC

    1.3 Special sets

    Some sets turn up so often that we have special symbols for them in a special typeface knownas Blackboard Bold:

    N = {1, 2, 3, . . . } = (the set of) Natural NumbersZ = {. . . ,2,1, 0, 1, 2, 3, . . . } = (the set of) IntegersQ =

    {pq

    p, q Z with q 6= 0} = (the set of) Rational NumbersR = (the set of) Real Numbers

    The last set contains all numbers that can be represented on the number line including therational numbers and numbers such as

    2,

    3, pi, . . . that are termed irrational.

    1.4 Variants of set-builder notation

    Set builder notation may also be used as follows:

    {x A | P (x)} denotes the set of all x that are already in A such that x has the propertyP , e.g. {x Z | x is even} is the set of all even integers. {f(x) | x A} denotes the set of all objects with pattern f(x) such that x is in A. We

    saw this form above, in the definition of the rational numbers Q. For a simpler example,consider: {2x | x Z} is another way of specifying the set of all even integers. {f(x) | P (x)} is the most general form of set builder notation, e.g. above we saw: {p2 |p is a prime}, the set of squared prime numbers.

    1.5 Subsets and supersets

    Given two sets A and B, we say that A is a subset of B, and write A B, if every element ofA is also an element of B. Notice that in particular, B is a subset of itself. If a subset A of Bis not equal to B, we say A is a strict subset of B or that A is a proper subset of B.

    If A is a subset of B, then one can also say that B is a superset of A, and write: B A.We also say that A is contained in B, or that B contains A.

    Note that two sets A,B are equal, written A = B, if and only if both A B and B A.Usually when trying to prove that two sets are equal, one shows each set is contained in theother.

    Let P = {p N | p is prime}, then we have the following sequence of inclusions, i.e. asequence of sets for which each set is a subset of the next:

    P N Z Q R.

    1.6 Universal sets and complements

    Often we consider all sets as being subsets of some given universal set. E.g., if we are investi-gating properties of the real numbers R (and subsets of R), then we may take R as our universalset.

  • 1.7. UNIONS, INTERSECTIONS, AND RELATIVE COMPLEMENTS 9

    Given a universal set U and a subset A of U , we may define the complement of A (in U) as

    Ac = {x U | x / A}.

    In other words, Ac (A-complement) is the set of all elements of U which are not elements ofA. The notations A and A are also commonly used to represent the complement of A. Thus,the complement Ec of the set E = {2x | x Z} (the set of all even integers) in Z, is the set ofall odd integers, while the complement of E in R is the set of all real numbers that are eitherodd integers or not integers at all.

    1.7 Unions, intersections, and relative complements

    Given two sets A and B, their union, written A B, is the set consisting of all objects whichare elements of A or of B (or of both).

    The intersection of A and B, written A B, is the set of all objects which are both in Aand in B.

    Finally, the relative complement of B relative to A, also known as the set(-theoretic) dif-ference of A and B, is the set of all objects that belong to A but not to B. It is written asA \B.

    Formally, these sets are:

    A B = {x | (x A) or (x B)},A B = {x | (x A) and (x B)},A \B = {x A | x / B}.

    The (absolute) complement Ac of a set A (in a universal set U) using the set difference notationis U \ A.

    1.8 De Morgans Laws

    The following statements, known as de Morgans Laws, are true for any sets A and B. Each iseasy to prove using Venn diagrams.

    (A B)c = Ac Bc(A B)c = Ac Bc

    Note that when we draw a Venn diagram that is supposed to represent a general situation eachset should be drawn to intersect each other set (this represents a general situation, since it canstill happen that any region may actually be empty). Thus, a Venn diagram with two sets Aand B should be drawn as two intersecting circles in a rectangle representing the universal setU .

  • 10 CHAPTER 1. SETS AND LOGIC

    1.9 Symbols Summary

    x A means that x is an element of A.A B is the union of A and B, i.e. A B = {x | x A or x B}

    (in mathematics or means and/or).

    A B is the intersection of A and B, i.e. A B = {x | x A and x B}.A B means that A is a subset of B, i.e. x A = x B.A B means that A is a proper subset of B, i.e. A B and A 6= B.A \B (or AB) is A take B, i.e. the set {x A | x / B}.{}, is the empty set, i.e. the set with no elements.

    Note that is a subset of every set.Ac, A, A is the complement of A, i.e. A = {x | x / A}.

    Here x belongs to some universal set which shouldbe clear from the context.

    1.10 The connection between Set Theory and Logic

    Logic deals with statements that are either true or false, whereas Set Theory deals withelements of sets a given element can either be in a given set or not in the set. Let A,Brepresent sets. Also, let p, q represent statements and p represents the negation of p (if p istrue then p is false, and vice-versa).

    A right arrow () denotes implies. If p q, then, when p is true so is q.A double-arrow () is the corresponding symbol for equals; it denotes its operands are

    logically equivalent. If p q then, when p is true, so is q, and when p is false, so is q).A way of viewing the connection between Set Theory and Logic: is to say that the statements

    in Logic tell us which regions of a given Universal set are non-empty. With this view, one canoften convert a Set Theory statement to a Logic one by sticking x in front of it, e.g.

    A B x (A B) x A or x B

    Now, x A and x B are examples of statements p and q, respectively.We give a few examples of this correspondence between Set Theory and Logic:

    Set Theory LogicA B p or qA B p and qA = B p qA B p q

    (A B) = A B (p or q) p and q(A B) = A B (p and q) p or q

    The statement p q has particular importance. From the Set Theory perspective, we aresaying that A B = or equivalently that the Universal set is A B, so that we have thefollowing logical equivalence:

    p q p or q.

  • 1.11. LOGIC WITH QUANTIFIERS 11

    In Logic it is customary to use (vee) for or, (wedge) for and and for negation (i.e. wewrite p for p). So the above statement may also be written as it appears in the first exercise.

    1.11 Logic with Quantifiers

    The following are known as the universal quantifier and existential quantifier, respectively.

    (which is an inverted A) means for All. (a back-to-front E) means there Exists.

    If P (x) represents a statement that depends on x, then the following are logical equivalences:

    xP (x) x(P (x))xP (x) x(P (x)).

    Sometimes we write the quantifiers at the back of an expression rather than at the front. Themeaning is the same, but a trailing x reads better as: for some x.Exercise Set 1.

    1. Use a truth table to prove that p q is logically equivalent to p q, i.e. show(p q) (p q)

    is a tautology (i.e. has value true for all possible inputs of p and q).

    2. Use 1. to show p q is logically equivalent to its contrapositive q p.3. Write the statement,

    In every class there is at least one student who gets everything right.

    symbolically using quantifiers.Hint. For example, let R(c, s, p) represent Student s in class c gets problem p correct.

    Then write the negation of this statement as an existential statement (i.e. beginning with), symbolically, and then translate that statement back into English.

    4. Noting that we often add s.t. (abbreviating such that) to improve the readability ofa clause following , rewrite

    x R,y R s.t. y = cos(x)so that the first quantifier in the sentence is .

  • 12 CHAPTER 1. SETS AND LOGIC

  • CHAPTER 2

    Proof Techniques

    2.1 Propositions

    If P and Q are statements thenP = Q

    means that P implies Q, i.e. that whenever P is true then Q must also be true. There areseveral other ways of saying this. Simplest is just If P then Q, and there is P only if Q.You can also say that P is a sufficient condition for Q; or that Q is a necessary conditionfor P . For example, if A is the statement n is a prime and B is the statement n is a naturalnumber then A = B is a proposition.

    The sort of propositions that are important in mathematics are theorems, corollaries(singular: corollary) and lemmas. Theorems are the most important: everybody knowsabout Pythagoras Theorem. In this course, (and in other advanced mathematics) a theoremappears in two parts. The first is a statement of the theorem, with some sort of label likeTheorem 5 or Lagranges Theorem. The second part is the proof of the theorem whichbegins with the word Proof and ends with the symbol . Lemmas are (usually short, easy)propositions that are used to prove theorems; corollaries are propositions that follow easilyfrom theorems.P is the negation of P , e.g. if A is the statement n is a prime then A would mean n

    is not a prime.If P = Q and Q = P we write P Q or P if and only if Q. We can also say

    P is a necessary and sufficient condition for Q. A shorthand way of writing if and onlyif is the odd-looking word iff .

    Definition 2.1.1. The converse of P = Q is Q = P .Note that we might have P = Q being true but Q = P being false. Can you think

    of statements P and Q for which this is so?

    Definition 2.1.2. The contrapositive of P = Q is Q = P .If P = Q is true then its contrapositive is true, and vice versa. Thus we can say for any

    statements P and Q,P = Q iff Q = P.

    2.2 Direct Proofs

    The most straightforward way of proving a theorem is by direct proof . To prove P = Qwe show

    P = A1A1 = A2A2 = A3

    ...

    An1 = AnAn = Q

    13

  • 14 CHAPTER 2. PROOF TECHNIQUES

    Example 2.2.1.

    Proposition. The sum of two even integers is even.

    Proof. Let a, b be two even numbers. An even number is divisible by 2.

    = m,n Z such that a = 2m and b = 2n= a+ b = 2m+ 2n = 2(m+ n)= a+ b is even.

    Note that the proof ends in . This is the modern fashionable way to end proofs, theold-fashioned way was to write QED which is short for Quod erat demonstrandum which isLatin for which was to be proved.

    2.3 Proof by Contraposition

    We said above that P = Q is equivalent to its contrapositive Q = P . Sometimes itseasier to prove the contrapositive proposition than the original one. Thus, to prove P = Qwe assume Q is true then show that Q = P by direct proof.Example 2.3.1.

    Proposition. If a Z and a2 is odd then a is odd.

    Proof. Suppose (a is odd).= a is even= m such that a = 2m= a2 = 4m2 = 2(2m2)= a2 is even= (a2 is odd)

    Thus the proposition is proved by contraposition.

    2.4 Proof by Contradiction

    To prove a statement by contradiction, we show that the statement being false leads to anabsurdity, leaving us to conclude that if the statement is not false, then in fact it is true.

    Now a statement of form P = Q is vacuously true whenever P is false. It is also true ifQ is true.

    This leaves the case when both P is true and Q is false. If we can show this combinationof possibilities cannot occur, we will have shown that a statement of form: P = Q is true.

    Thus a proof of P = Q generally starts by assuming P and Q and proceeds until acondition known to be untrue occurs, in which case we have whats termed a contradiction, andare then able to deduce that the original statement was in fact true, i.e. the proof is shapedlike this:

  • 2.5. IDENTITIES 15

    Suppose P and Q.

    = . . ....

    = R [where R is something known to be untrue]

    Thus we have a contradiction.Hence in fact, P = Q (is true).

    The following famous result demonstrates a proof by contradiction.

    Theorem 2.4.1. The set of primes is infinite.

    Proof. Suppose there are only finitely many primes and label them

    p1 = 2 < p2 = 3 < p3 = 5 < < pn.

    Let N = p1p2 pn + 1. Now N is a product of primes,

    = N is divisible by some prime in our list, say pi= m Z such that N = pim= pim = p1p2 pn + 1= pim p1p2 pn = 1= pi(m p1p2 pi1pi+1 pn) = 1

    This is a contradiction since the left hand side is divisible by pi but the right hand side is not.Thus the set of primes is infinite.

    2.5 Identities

    An equation that it is true for any choice of the variables is called an identity. Some well-knownidentities that should be familiar to you are

    (a+ b)2 = a2 + 2ab+ b2

    (a b)2 = a2 2ab+ b2(a+ b)(a b) = a2 b2

    To prove an identity, one starts with one side, e.g. the lefthand side (LHS), and by a sequenceof steps reduces it to the other side, e.g. the righthand side (RHS). The proof should have thisshape:

    LHS = ...

    = RHS

  • 16 CHAPTER 2. PROOF TECHNIQUES

    As an example, we prove the first of the identities above:

    LHS = (a+ b)2

    = (a+ b)(a+ b)

    = a(a+ b) + b(a+ b)

    = a2 + ab+ ba+ b2

    = a2 + 2ab+ b2, since ab = ba

    = RHS

    2.6 Proof by Mathematical Induction

    In this case we want to prove an infinite set of statements P (1), P (2), P (3), . . . , or equivalentlywe want to prove,

    n N, P (n) is true.We prove this in two steps:

    (i) We show that P (1) is true.

    (ii) We show that k N, P (k) = P (k + 1).Example 2.6.1.

    Proposition. If n N then

    P (n) : 1 + 3 + 5 + + (2n 1) = n2 (2.6.1)

    Proof. (i) If n = 1 then the lefthand side of (2.6.1) equals 1, and the righthandside is 12 = 1. So the proposition is OK for n = 1.(ii) Suppose (2.6.1) is OK for k, i.e. suppose that P (k) is true. Then

    LHS of P (k + 1) = 1 + 3 + + (2k 1) + (2(k + 1) 1)= LHS of P (k) + 2k + 1

    = k2 + 2k + 1

    = (k + 1)2 = RHS of P (k + 1)

    Thus P (k + 1) follows from P (k).Now from (i) and (ii) together, we have

    1 + 3 + 5 + + (2n 1) = n2 n N.

  • 2.7. EXAMPLE OF A DIRECT PROOF 17

    2.7 Example of a Direct Proof

    Below we will need the following useful idea. Recall that the graph of y = x2 looks like:

    0x

    y

    The important observation to make is that for any real number x, x2 is never negative, and isonly zero when x itself is zero, i.e.

    x2 0 for all real x, andif x2 = 0 then x = 0.

    This innocuous statement is incredibly useful. Keep it in your box of tricks!! We use it in thethird line of the proof below.

    Exercise. Prove that:

    If a, b 0 thenab a+ b

    2.

    Solution. The statement is of the form: If P then Q. (or equivalently: P = Q).A direct proof of such a statement has the form:

    Assume P

    = . . .= . . ....

    = Q

    In this case, P is a, b 0 and Q is ab (a+ b)/2.Proof. Assume a, b 0.

    = a,b exist, i.e. are real numbers

    = (ab)2 0

    = a 2a.b+ b 0

    = a+ b 2ab

    = a+ b2ab

    =ab a+ b

    2.

  • 18 CHAPTER 2. PROOF TECHNIQUES

    2.8 Example of a Proof by Contradiction

    Exercise. Prove that:

    2 is irrational.

    Solution.

    Proof. For a contradiction assume that

    2 is rational.

    =

    2 =p

    qfor some p, q Z with gcd(p, q) = 1

    = 2 = p2

    q2

    = 2q2 = p2= 2 p2, since 2q2= 2 p= p = 2r for some r Z= 2q2 = (2r)2 = 4r2= q2 = 2r2= 2 q2, since 2r2= 2 q= gcd(p, q) 2, since now 2 p and 2 q

    So now we have a contradiction (gcd(p, q) = 1 contradicts gcd(p, q) 2).

    2 is not rational.

    2 is irrational.

    Exercise Set 2.

    1. Let n be a positive integer and d its smallest divisor greater than 1. Prove that d is prime.

    2. Prove that if x, y are positive numbers then x+ y 2xy.3. A right-angled triangle has sides of length a, b, and c with c being the hypotenuse. If the

    triangle has area c2/4, show that it is isosceles.

    4. Prove that if p is a prime and q is a positive integer less than p, then p and q are relativelyprime.

    5. Prove that if a, b and c are real numbers such that a2 + b2 + c2 = 0, then a = b = c = 0.

    6. Prove that the numbers n 1 and n+ 15 are relatively prime for every even integer n.7. Prove that the sum of two real numbers one of which is rational and the other irrational

    is an irrational number.

    8. Prove that

    2 is irrational.

    9. Prove that if m is an integer and 2m 1 is a prime, then m is also a prime.

  • CHAPTER 3

    Mathematical Induction

    We already visited induction as a proof technique in the last chapter. We describe it again; thistime, in terms of a ladder, which will help us later in understanding other forms of induction.

    Suppose you need to find a general formula for the sum of the first n natural numbers.Ignoring that we could use the theory of arithmetic progressions, you might start by lookingfor a pattern:

    1 = 1

    1 + 2 = 3

    1 + 2 + 3 = 6

    ...

    and if you are lucky you might guess that: 1 + 2 + + n = n(n+ 1)2

    ,

    but how might you show that this is true, for any natural number n?One way is to use the Principle of Mathematical Induction (PMI). The idea is that you

    start with some statement that depends on a natural number n. (A statement is somethingthat can be either true or false.) Call this statement P (n). Then the PMI states:

    If we can show that both

    P (1) is true; and for a general natural number k, if P (k) is true then P (k + 1) is also true;

    then we can conclude that P (n) is true for all natural numbers n.

    This is exactly like proving that we can climb a ladder, in the following way.

    First we show we can get on the first (bottom) rung. Then we show we can get from any one rung (i.e. the kth rung) to the next rung (i.e. the

    (k + 1)st rung).

    It should be clear that we could then get to any rung of the ladder we like (given enough time).Let us prove our simple example above by induction.

    Example 3.1. First we define P (n) : 1 + 2 + + n = n(n+ 1)2

    .

    Notice, a : was used here to indicate that P (n) is short-hand for everything thatfollows the :. Use of a symbol like = instead of : would have been too confusing!

    Show P (1) is true;Proof. P (1) is of the form LHS = RHS. To show it is true we start with one side and reduce itto the other side. Now the LHS of P(1) is just 1 and the RHS of P(1) is 122 , i.e.

    LHS of P (1) = 1

    =1 2

    2= RHS of P (1)

    So P (1) is true.

    19

  • 20 CHAPTER 3. MATHEMATICAL INDUCTION

    Show, for a general natural number k: if P (k) is true then P (k + 1) is also true;

    Proof. To prove a statement of form:

    If hypothesis then conclusion

    we assume the hypothesis and deduce from it, the conclusion. Hence, we assume P (k) is true,i.e. we assume

    LHS of P (k) = RHS of P (k).

    Now we wish to deduce that P (k + 1) is true. Now P (k + 1) is of the form LHS = RHS. Soto show it is true we start with one side and reduce it to the other side. (Somewhere along theway we expect to use our assumption that P (k) is true incidentally, this assumption is calledthe inductive assumption). Thus, starting with one side . . .

    LHS of P (k + 1) = 1 + 2 + + k + k + 1=(LHS of P (k)

    )+ k + 1

    = (RHS of P (k)) + k + 1, (using the inductive assumption)

    =k(k + 1)

    2+ k + 1

    =k(k + 1) + 2(k + 1)

    2

    =(k + 1)(k + 2)

    2

    =(k + 1)

    ((k + 1) + 1

    )2

    = RHS of P (k + 1)

    So, if P (k) is true then P (k + 1) is true.

    Thus we may now deduce that, by the PMI, P (n) is true for all natural numbers n.

    Example 3.2. Prove that:

    If x+1

    xis an integer then xn +

    1

    xnis an integer for all positive integers n.

    You will notice differences between the structures of our proof below and that ofour elementary example above, but you will notice also great similarities. One of

    the differences is that the can get onto the next rung step of the proof requires twoprevious rungs, which means that the can get onto the first rung step of the proof mustbe replaced with a proof that one can get onto the first two rungs think of the ladder.

  • 21

    Proof. Assume x+1

    xis some integer N .

    We show that xn +1

    xnis an integer for all positive integers n, by induction.

    Let P (n): f(n) = xn +1

    xnis an integer.

    Firstly, we prove P (1) and P (2).

    f(1) = x1 +1

    x1= x+

    1

    x

    So . . . f(1) = x1 +1

    x1is an integer, i.e. P (1) is true.

    f(2) = x2 +1

    x2= (x+

    1

    x)2 2x 1

    x= N2 2

    So . . . f(2) is an integer, i.e. P (2) is true.

    Now we prove: if P (k 1) and P (k) are true then P (k + 1) is true, for k 2.

    Assume P (k1) and P (k) are true, i.e. that f(k1) and f(k) are integers.Then

    f(k + 1) = xk+1 +1

    xk+1

    =(xk +

    1

    xk)(x+

    1

    x

    ) xk 1x 1xk x

    =(xk +

    1

    xk)(x+

    1

    x

    ) (xk1 + 1xk1

    )= f(k).N + f(k 1).

    So f(k+1) is an integer, if f(k1) and f(k) are, i.e. for k 2, if P (k1)and P (k) are true then P (k + 1) is true.

    Thus, by induction, P (n) is true for all positive integers n.

    Hence, we have shown that, if x +1

    xis an integer then xn +

    1

    xnis an integer for all positive

    integers n.

  • 22 CHAPTER 3. MATHEMATICAL INDUCTION

    Exercise Set 3.

    1. Prove for any natural number n that

    (i) 1 + 3 + 5 + + 2n 1 = n2;(ii) 12 + 22 + 32 + + n2 = 1

    6n(n+ 1)(2n+ 1);

    (iii) 13 + 23 + 33 + + n3 = 14n2(n+ 1)2;

    (iv) 12 + 42 + 72 + + (3n 2)2 = 12n(6n2 3n 1);

    (v) 22 + 52 + 82 + + (3n 1)2 = 12n(6n2 + 3n 1).

    2. Prove that for any natural number n,

    2(n+ 1 1) < 1 + 1

    2+ + 1

    n< 2n.

    3. Prove 3n > 2n for all natural numbers n.

    4. Prove Bernoullis Inequality which states:

    If x 1 then (1 + x)n 1 + nx for all natural numbers n.5. Prove that for any natural number n 2,(

    1 12

    )(1 1

    3

    ) (1 1n

    ) 1. The lesson with this example is that sometimes one needs to prove something stronger.A naive (perhaps, that should be: first) attempt at the problem, might be to define

    P (n) :122

    +132

    + + 1n2

    < 1

    and try to prove P (n) by induction for all n 2, but at the inductive step we seem to bestuck because we want to increase the righthand side.

    11. Show that, for each positive integer n, there exists a positive integer x such thatx+ 2004n +

    x = (

    2005 + 1)n.

    (AMO 2008, Problem 4)

    12. Given

    x1 = 1

    xn+1 = xn +1

    2xnprove that b25x625c = 625.

    13. What are the last two digits of 2222? Some ideas: You might be wondering what Eulers Theorem or Fermats LittleTheorem have to say about this. You should be able to see that the problem is

    equivalent to asking what 2222 modulo 100. Since 100 is not prime, we cannot use FermatsLittle Theorem, and we cannot use Eulers Theorem directly since 2 and 100 are notcoprime, but one could find what 2222 modulo 25 by Eulers Theorem and lift that to aresult modulo 100.

    Another approach is repeated squaring. This certainly works, and on a computer isquite fast, but for a human its a bit tedious.

    Yet another approach is to recover something that looks a little like a Fermats LittleTheorem result, namely finding a cycle such that:

    2k+` 2k (mod 100).

    In fact, one finds that

    22 4 (mod 100) and 212 = 4096 4 (mod 100).

    Note that this does not imply that 210 is congruent to 1 modulo 100, since 22 does nothave a multiplicative inverse modulo 100, but nevertheless one can show (by induction):

    22+10n (1)n22 (mod 100)

    and use it to solve the problem.

  • 24 CHAPTER 3. MATHEMATICAL INDUCTION

  • CHAPTER 4

    Algebra: Quadratic polynomials and Vie`tes Theorem

    4.1 Polynomials

    Let x be a variable that can take any number as a value. Then an expression of the form

    a0 + a1x+ a2x2 + + anxn

    where a0, a1, . . . , an are fixed numbers is called a polynomial in x; and the numbers a0, a1, . . . , anare called the coefficients of this polynomial in x. For convenience, we usually like to givesuch expressions some sort of label; so that we will usually write something like:

    Let p(x) = a0 + a1x+ a2x2 + + anxn.

    (Here p(x) is said: p of x). Then, writing p(3) is a shorthand way of writing:

    a0 + a1 3 + a2 32 + + an 3n(the expression p(x) with 3 substituted for each occurrence of x)

    Also, we will often say for p(3), the value of the polynomial p(x) at x = 3 or p(x) evaluated atx = 3 or just simply, p of 3.

    Generally, we like to have an 6= 0; then anxn is called the leading term (and an, itself, isthe leading coefficient) of the polynomial p(x), and n is called the degree of p(x). If an = 1then the polynomial p(x) is called a monic polynomial. Also, a0 is called the constant termor constant coefficient of p(x).

    Now an equation is something of the form

    expression = expression.

    So a polynomial equation is something of the form

    polynomial = expression,

    where the expression on the right-hand side is usually just a value (i.e. a number) and thatvalue is usually 0.

    Now, a polynomial equation (in x) usually only makes sense for a small number of x values.For example,

    x2 1 = 0only makes sense for the x-values, 1 and 1. We say, the polynomial equation x21 is satisfiedby 1 and 1; or we say, it has roots 1 and 1; or we say, it has solutions 1 and 1.

    On the other hand, a polynomial p(x) is simply an expression in x. It makes sense, (i.e. hasa value) for any choice of x. Sometimes this value is 0. For this reason, a choice of x such thatp(x) evaluates to 0, is called a zero of p(x).

    Example 4.1.1.

    The polynomial x2 3x+ 2 has two zeros, namely 1 and 2. The polynomial equation x2 3x+ 2 = 0 has two roots, namely 1 and 2.

    (In this context, the term root can be used interchangeably with solution.)

    25

  • 26 CHAPTER 4. ALGEBRA: QUADRATIC POLYNOMIALS AND VIE`TES THEOREM

    So we see that the terms zero and root (or solution) generally amount to the same thingbut from different viewpoints!

    Two polynomials p(x), q(x) are said to be equal if they have the same value for every valueof x. This occurs if and only if p(x) and q(x) have the same degree and identical coefficients.Note that two polynomials can have the same value at several x-values without being equalpolynomials. (This can be confusing!)

    Example 4.1.2.

    The polynomials p(x) = x2 + 1 and q(x) = x4 + 1 are equal at x = 0, i.e.

    p(0) = q(0),

    but p(x), q(x) are not equal polynomials.

    The polynomials p(x) = (x 1)2 and q(x) = x2 2x+ 1 are equal polynomials, and oftenthis is written: p(x) = q(x). Usually, the context makes it clear what is meant, but toavoid any ambiguity it is a good idea to get into the practice of writing:

    p(x) = q(x) for all x.

    Polynomial Division

    Analogous to integer division, we can define division of a polynomial p(x) by a non-zero poly-nomial u(x). (The zero polynomial is the polynomial that evaluates to 0 for every value ofx it is usually written as: 0, which again can be quite confusing. A polynomial p(x) is anon-zero polynomial if it evaluates to a non-zero value for at least one x-value.) We definequotient and remainder polynomials of polynomial division as follows:

    If p(x) is a polynomial and u(x) is a non-zero polynomial then the quotient q(x)and remainder r(x) are the polynomials that satisfy

    p(x) = u(x).q(x) + r(x) (for all x)

    such that the degree of r(x) is less than the degree of u(x).

    We will only be considering the case where u(x) = x a for some fixed number a, i.e. we willonly consider the case where u(x) is of degree 1; in which case r(x), being necessarily of lowerdegree, consists of just a constant term and so is called a constant polynomial. If r(x) is thezero polynomial then u(x) (and also q(x) ) is a factor of p(x).

    There is an arithmetic on the degrees of polynomials. If p(x), q(x) have degrees n,mrespectively, then the degree of p(x) + q(x) is at most the maximum of m and n and

    p(x) q(x) is m+ n.

  • 4.2. QUADRATIC POLYNOMIALS 27

    The astute student will realise that to fit in with this (and the definition ofpolynomial division above, in the case that u(x) is a constant polynomial) we

    need a special degree definition for the degree of the zero polynomial. We invent a specialinteger which is smaller than any genuine integer and has the property that:

    + k =

    for any integer k. The zero polynomial is then said to have degree (rather than 0).All other constant polynomials have degree 0.Exercise 1: Check this definition for the degree of the zero polynomial is what we needed.Exercise 2: Show that unlike integer division, according to the definition above, divisionof a polynomial by a constant polynomial always gives the zero polynomial as remainder,i.e. non-zero constant polynomials are always factors.

    Now that we have a concrete idea of what polynomial division is, we are in a position to makesense of the following theorems.

    Theorem (Remainder Theorem). If the polynomial p(x) is divided by the polynomial x athen the remainder is p(a).

    Proof. Write p(x) = (x a)q(x) + r(x). Then r(x) is a constant polynomial (and so we may as welldrop the x and simply write r). Substituting a for x gives

    p(a) = (a a)q(a) + r= r.

    An immediate consequence of the Remainder Theorem is the following.

    Theorem (Factor Theorem). Let p(x) be a polynomial. Then a is a zero of p(x) if and only ifx a is a factor of p(x).Proof. This proof is left as an exercise.

    The polynomial p(x) = a0 + a1x + + anxn is said to be a polynomial over Z,or over Q, or over R, . . . if all the coefficients are in Z, or Q, or R, . . . respectively.

    Similarly, p(x) is said to factor over Z, or over Q, or over R, . . . if p(x) = u(x).q(x) forsome non-constant polynomials u(x), q(x) that are both polynomials over Z, or over Q,or over R, . . . respectively. Incidentally, this is why the coefficients were referred to asnumbers (rather than real numbers) above. A rather nice result that is helpful for findingrational zeros of polynomials over Z is the following.

    Theorem (Rational Zero Theorem). Let p(x) = a0 + a1x + + an1xn1 + xn be amonic polynomial over Z. If p(x) does not factor over Z then nor does it factor over Q.

    This means to find the rational zeros of a monic polynomial with integer coefficientswe only need to check all integer divisors of the constant coefficient a0.

    4.2 Quadratic polynomials

    A quadratic polynomial is simply a polynomial of degree 2, i.e. a polynomial of form

    ax2 + bx+ c

    where a, b, c are fixed numbers and a 6= 0. Let p(x) = ax2 + bx + c where a 6= 0. Then over Rusing the identity

  • 28 CHAPTER 4. ALGEBRA: QUADRATIC POLYNOMIALS AND VIE`TES THEOREM

    (A+B)2 = A2 + 2AB +B2

    we may write:

    p(x) = ax2 + bx+ c = a(x2 +

    b

    ax+

    c

    a

    )= a(x2 +

    b

    ax+

    ( b2a

    )2+c

    a ( b

    2a

    )2)= a((x+

    b

    2a

    )2+

    4ac b24a2

    )= a((x+

    b

    2a

    )2 b2 4ac4a2

    ).

    We would like to go further by using (in reverse) the identity

    (A+B)(AB) = A2 B2.This is only possible over R if the quantity = b2 4ac (called the discriminant of p(x) ) isnon-negative. Suppose that = b2 4ac 0 then we can write:

    p(x) = a((x+

    b

    2a

    )2 4a2

    )= a((x+

    b

    2a

    )2 (2a

    )2)= a(x+

    b

    2a+

    2a

    )(x+

    b

    2a

    2a

    )= a(x b

    2a

    )(x b+

    2a

    ).

    So we see that, if 0 then p(x) has zerosb

    2a,b+

    2a

    where = b2 4ac; and hence p(x) has two distinct real zeros, if > 0; two equal real zeros, if = 0; no real zeros, if < 0.

    Now, a real square is always either positive or zero. So(x+

    b

    2a

    )2 4a2

    4a2for all x.

    Hence, p(x) has a minimum value (respectively: maximum value) of4a

    , if a > 0 (respectively:

    if a < 0), and this value is attained at x = b2a

    .

    We finish this section with a fairly simple but very useful result.

    Theorem (Vie`tes Theorem). Let p(x) = x2 + bx + c be a monic quadratic polynomial withzeros , . Then

    b = + c = .

    Proof. First observe that(x )(x ) = x2 (+ )x+ .

    Now , are the zeros of p(x), and p(x) is monic; so p(x) must factor as per the left-hand side of theabove equation. The result now follows by comparison of coefficients of p(x) with the right-hand sideof the above equation.

  • 4.3. HORNERS METHOD AND SYNTHETIC DIVISION 29

    4.3 Horners Method and Synthetic Division

    A quick method for evaluating a polynomial at a point x0 is given by Horners Method,which is based on writing the polynomial in nested form:

    p(x) = anxn + an1xn1 + + a2x2 + a1x+ a0

    = (( (anx+ an1)x+ + a2)x+ a1)x+ a0To evaluate p(x0) then, we evaluate a sequence of numbers as follows

    bn = an

    bn1 = bnx0 + an1...

    b0 = b1x0 + a0.

    Then the final number b0 is p(x0), since

    p(x0) = (( (anx0 + an1)x0 + + a2)x0 + a1)x0 + a0= (( (bnx0 + an1)x0 + + a2)x0 + a1)x0 + a0= (( bn1x0 + + a2)x0 + a1)x0 + a0...

    = b1x0 + a0

    = b0.

    Of course, from above we saw that p(x0) is the remainder when p(x) is divided by x x0. Theway the above process is usually performed is via a tableau as below:

    an an1 an2 a0

    x0 bnx0 bn1x0 b1

    bn bn1 bn2 b0

    As a by-product, bn, bn1, . . . , b1 are the coefficients of the quotient when p(x) is divided byx x0, i.e.

    p(x) = (x x0)(bnxn1 + bn1xn2 + + b1) + b0.Example 4.3.1. Find p(3) by Horners Method/Synthetic Division for p(x) = x3+2x213x+10, and hence find the quotient and remainder when p(x) is divided by x 3.

  • 30 CHAPTER 4. ALGEBRA: QUADRATIC POLYNOMIALS AND VIE`TES THEOREM

    Exercise Set 4.

    1. The quadratic equation x2 3x 5 = 0 has roots , . Determine 2 +2 and 2 +2.2. The quadratic polynomial x2 + 4x 1 has zeros , . Determine 3 + 3 and 3 + 3.

    Hint. ( + )3 = 3 + 3 + 32 + 32 = 3 + 3 + 3( + ).

    3. Solve 2(x+

    1

    x

    )2 (x+ 1x

    )= 10.

    4. Use the Remainder and Factor Theorems to factorise

    (i) x3 2x2 5x+ 6 (ii) x3 5x2 + 3x+ 1

    5. The quadratic polynomial ax2 + bx 4 leaves remainder 12 on division by x 1 and hasx+ 2 as a factor. Find a, b and the zeros of the polynomial.

    6. Find a quadratic equation with roots 2 +

    3 and 23.7. June solved a quadratic equation of the form:

    ax2 + bx+ c = 0

    and got 2 as a root. Kay switched the b and the c and got 3 as a root. What was Junesequation?

    8. The equation x2 + ax + (b + 2) = 0 has real roots. What is the least value that a2 + b2

    could be?

    9. If a, b are odd integers, prove that the equation

    x2 + 2ax+ 2b = 0

    has no rational roots.

    10. Find p(1) and p(2) via Horners method, given p(x) = 2x4 3x3 2x2 + x 4.11. Find the quotient and remainder when

    (i) 3x5 + 2x4 3x2 + 2x 7 is divided by x+ 2;(ii) x3 + 3x2 5x+ 6 is divided by (x 1)(x+ 2);

    (iii) x4 2x3 + x2 5x+ 11 is divided by x2 + 3x+ 2.

  • CHAPTER 5

    Factorisation Background

    As usual, we will take n to represent a natural number, i.e. n is assumed to be a positive integer.

    Factorisation of an bn

    Let us start with something familiar, summing

    1 + r + r2 + + rn1.

    This is a geometric series with common ratio r (with 1 as the first term). Its useful to givethe series a name. Lets call it Sn (the sum to n terms). Then

    Sn = 1 + r + r2 + + rn1 (5.1)

    rSn = r + r2 + + rn1 + rn (5.2)

    (1 r)Sn = 1 rn, subtracting (5.2) from (5.1). (5.3)

    In the context of geometric series, we would then proceed to isolate Sn, but in the currentcontext, substituting (5.1) back in (5.3) and swapping the lefthand and righthand sides, givesus the factorisation

    1 rn = (1 r)(1 + r + r2 + + rn1).Now replace r by b/a, and then multiply through both sides by an:

    1( ba

    )n=

    (1

    ( ba

    ))(1 +

    ( ba

    )+( ba

    )2+ +

    ( ba

    )n1)an bn = (a b)(an1 + an2b+ + ankbk1 + + bn1). (5.4)

    In multiplying the righthand side by an, we multiply the first bracket by a and the secondbracket by an1, and note that that means the sum of the indices appearing in each term inthe second bracket is n 1. We now have a factorisation of an bn.

    To get a similar factorisation of an + bn, we replace b by b in (5.4). Note that, in orderfor this to actually give us a factorisation of an + bn, we need (b)n = bn, i.e. n must be odd.Thus,

    an (b)n = (a (b))(an1 + an2(b) + + ank(b)k1 + + (b)n1)=(a (b))(an1 + an2(b) + + ank(b)k1 + + (b)n1)

    an + bn = (a+ b)(an1 an2b+ + (1)k1ankbk1 + + bn1), for n odd. (5.5)

    Observe that (b)n1 = bn1 in (5.5), since n 1 is even.Summarising, we have

    an bn = (a b)(an1 + an2b+ + ankbk1 + + bn1)an + bn = (a+ b)(an1 an2b+ + (1)k1ankbk1 + + bn1), for n odd.

    31

  • 32 CHAPTER 5. FACTORISATION BACKGROUND

    Expansion of the binomial (a+ b)n

    Now consider the expansion of (a + b)n. For completeness (it gives the first line of PascalsTriangle), also consider n = 0:

    (a+ b)0 = 1

    (a+ b)1 = a+ b

    (a+ b)2 = a2 + 2ab+ b2

    (a+ b)3 = a3 + 3a2b+ 3ab2 + b3

    and in general

    (a+ b)n =

    (n

    0

    )an +

    (n

    1

    )an1b+ +

    (n

    r

    )anrbr + +

    (n

    n

    )bn,

    where (n

    r

    )=n(n 1)(n 2) (n r + 1)

    r(r 1)(r 2) 1 .

    Note that there are r factors in both the numerator and denominator of(nr

    ). The formula above

    doesnt appear to given an expression for r = 0. Just remember that empty products are 1, sothat

    (n0

    )= 1. (Similarly, empty sums are 0.)

    Binomial coefficients have the following properties:(n

    0

    )= 1(

    n

    1

    )= n(

    n

    r

    )=

    (n

    n r), (the symmetry property)(

    n+ 1

    r + 1

    )=

    (n

    r

    )+

    (n

    r + 1

    )

  • 33

    Exercise Set 5.

    1. Expand:

    (i) (1 + a)(1 + b)(1 + c)

    (ii) (1 + x)3(iii) (a+ b+ c)3

    (iv) (a+ b)4

    2. Factor:

    (i) a b as the difference of two squares;(ii) x+ 2

    xy + y, where x, y 0;

    3. Factor:

    (i) a6 b6 as the difference of two squares;(ii) a6 b6 as the difference of two cubes;

    Fully factor:

    (iii) a6 b6

    4. Factor fully (over Q):

    (i) (a+ b)2 c2(ii) a4 + 2a2b2 + b4

    (iii) a4 + a2b2 + b4

    (iv) x4 + 3x2 + 4

    (v) x4 15x2y2 + 9y4(vi) a2 2a b2 + 1

    5. Find all possible integers solutions to the equation

    x2 + y2 + z2 = 10(x+ y + z).

    Prove that there are no other integer solutions.

    6. Express

    2(a b)(a c) + 2(b c)(b a) + 2(c a)(c b)as the sum of three squares.

    7. If x+ 3 divides 3x2 + x+ k without remainder, find the value of k.

    8. Factor n4 + 4 as the product of two quadratics.For what positive integer values of n is n4 + 4 a prime number?

    9. Factor:

    (i) 1 + y(1 + x)2(1 + xy)

    (ii) 1 b a2 + a3b+ a2b3 a3b3

  • 34 CHAPTER 5. FACTORISATION BACKGROUND

    10. Given that (n

    r

    )=n(n 1)(n 2) (n r + 1)

    r(r 1)(r 2) 1 ,

    (i) find(213

    )and

    (125

    ).

    (ii) Show that

    (n

    r

    )=

    n!

    r!(n r)! .

    11. (i) Show that the sum of the coefficients of the rth and (r + 1)st term in the expansionof (1 + x)n is equal to the (r + 1)st term in the expansion of (1 + x)n+1. (To avoidawkward numbering of the terms, let us call the x0 term, the zeroth term, so thatthe rth term is the term involving xr.)

    (ii) Prove the same result using the factorial expression of(nr

    ).

    (iii) How is the result connected with Pascals Triangle?

    12. Given the Binomial Theorem result:

    (1 + x)n =

    (n

    0

    )+

    (n

    1

    )x+

    (n

    2

    )x2 + +

    (n

    n

    )xn,

    prove each of the following.

    (i)(n0

    )+(n1

    )+(n2

    )+ + (n

    n

    )= 2n

    (ii)(n0

    ) (n1

    )+(n2

    ) + (1)n(nn

    )= 0

    (iii)(n0

    )+ 2(n1

    )+ 4(n2

    )+ 8(n3

    )+ + 2n(n

    n

    )= 3n

    (iv)(n0

    ) 2(n1

    )+ 4(n2

    ) 8(n3

    )+ + (1)n2n(n

    n

    )=

    {1, if n is even

    1, if n is odd13. Prove that (

    n

    r

    )=n r + 1

    r(

    n

    r 1),

    and hence find the value of r that maximises(nr

    ).

    14. Observe that in any row of Pascals Triangle that the sum of the odd-indexed elementsis equal to the sum of the even-indexed elements, i.e.(

    n

    1

    )+

    (n

    3

    )+ =

    (n

    0

    )+

    (n

    2

    )+ .

    Prove this result.Hint. Youve already done it!

    15. Show

    (i) 3 539 239.(ii) 5 299 + 399.

    (iii) 5 - 298 + 398.

    (iv) 7 299 + 399 + 499 + 599.

    (v) 10 299 499 799 + 999.

  • 35

    16. Find a short expression for the following.

    (i) 1 + x+ x2 + + xn for all positive integers n.(ii) 1 x+ x2 + xn for all even positive integers n.

    17. Factor

    (i) a6 b6 as the product of four factors.(ii) a2(b c) + b2(c a) + c2(a b)

    18. If x and y are positive integers find all all solutions of

    x2 871 = y6.

    19. If(a 1

    a

    )2= 3 and a 1

    a> 0, evaluate

    (i) a3 1a3

    (ii) a4 +1

    a4

    20. If a is the difference between any quantity and its reciprocal, and b is the differencebetween the square of the same quantity and the square of its reciprocal, show that

    a2(a2 + 4) = b2.

    21. Prove that 1991 3500n 728n 785n + 4n for all n N.

  • 36 CHAPTER 5. FACTORISATION BACKGROUND

  • CHAPTER 6

    Number Theory introduction

    Number Theory is mainly concerned with properties of the natural numbers (or positive inte-gers):N = Z+ = {1, 2, 3, . . . }

    and more generally with the integers:

    Z = {. . . ,3,2,1, 0, 1, 2, 3, . . . }.Division Algorithm. For integers a, b with a > 0 there exist integers q (the quotient) and r(the remainder) such that

    b = aq + r and 0 r < a.Essentially q, r are the numbers that make the following division work:

    q rem. ra ) b

    (Usually b > 0, but this is not necessary.)

    Lets apply the Division Algorithm to a few examples:

    if a = 7 and b = 22 we write 22 = 7 3 + 1 (so q = 3 and r = 1);if a = 113 and b = 355 we write 355 = 113 3 + 16 (so q = 3 and r = 16);if a = 8 and b = 72 we write 72 = 8 9 + 0 (so q = 9 and r = 0).

    6.1 Divisibility

    In the special case where the division algorithm applied to two integers a, b as described aboveyields a remainder of 0, we have that b is divisible by a, or b is a multiple of a, or more succinctlywe say a divides b and write: a b. Thus, we have the following definition:

    If a, b Z we say: a divides b, and write: a b, if b = aq for some integer q. Otherwise, adoes not divide b and we write: a - b. For example,

    7 35, 3 21, 4 0 and (a+ 1) a2 1 for any integer abut

    7 - 33, 3 - 22, 0 - 4.If a b then we also say: a is a divisor (or factor) of b. For example, if b = 12 then the divisors(factors) of b are

    a {1, 2, 3, 4, 6, 12}. Dont confuse the divides symbol: (which is a vertical stroke with a little spacearound it) with the slash symbol: / (which separates the numerator and denominator

    of a fraction). Also, note that despite the symmetry of the symbol: the symbol cannotbe used in reverse, i.e. a b and b a mean different things (in fact, if they are both truethen a = b).

    6.1.1 Summary of divisibility terms

    Summarising the above statements, all the following say the same thing about integers a, bwhere a 6= 0.

    37

  • 38 CHAPTER 6. NUMBER THEORY INTRODUCTION

    a divides b. a b. a is a divisor of b. a is a factor of b.

    b = aq for some integer q. b/a is an integer. b is divisible by a. b is a multiple of a.

    Property 1. If a b and a c then a bx+ cy for any integers x, y.

    Proof. Suppose a b and a c. Then b = aq and c = ar for some integers q, r. So, for anyintegers x, y,

    bx+ cy = a(qx+ ry)

    and qx+ ry is an integer, and hence a bx+ cy.

    6.2 Prime numbers

    A prime number is a natural number larger than 1 that is only divisible by itself and 1.A natural number that is neither 1 nor prime is called composite.

    Notice that 1 is neither prime nor composite. In fact, 1 is called a unit (the technicalterm for a number that divides all integers).

    What makes primes so interesting is that every natural number (other than 1) can be expressedin just one way (except that we may be able to arrange the factors in many ways) as the productof prime divisors, e.g.

    74844 = 22 35 7 11.Such a factorisation is called a prime decomposition.

    If we were to include 1 as a prime then 74844 = 15 22 35 7 11, say, would beanother prime decomposition. Excluding 1 as a prime ensures the uniqueness of

    prime decompositions.

    The above fact is so important it is given a special name. Lets give it its name and recapwhat it says, and follow it up by an equally important result from the Greek, Euclid:

    Fundamental theorem of arithmetic. Any natural number n, other than 1, can be writtenuniquely as follows:

    n = pe11 pe22 pekk ,

    where k is a natural number, each pi is a prime number and 1 < p1 < p2 < < pk, and eachei is a natural number.

    Euclids Lemma. If a prime p divides ab then p a or p b.

  • 6.2. PRIME NUMBERS 39

    6.2.1 Sieve of Eratosthenes

    The Sieve of Eratosthenes (name is pronounced: error-toss-the-knees) is a method for findingall the primes less than (or equal to) some number N . This is done by performing the followingsteps.

    1. Start by writing down all the natural numbers from 1 upto N .

    2. Cross out 1 . . . 1 is not prime (by definition).

    3. The first number not crossed out is 2 . . . it must be prime; put a box around it and crossout all multiples of 2 in the list . . . i.e. cross out 4, 6, 8, . . . .

    4. Go back to the start of the list and box the first number that is not crossed out or boxed. . . it must be prime; and cross out all multiples of that number in the list. (Note. Somemultiples may already have been crossed out.)

    5. Repeat Step 4. until every number in the list is either boxed or crossed out.

    After performing these steps, the list of all primes less than or equal to N are just those numbersthat are boxed. Eratosthenes (c. 276 BC194 BC) was a Greek mathematician, historian, astronomer,

    poet and geographer. Born at Cyrene in northern Africa he lived much of his life inAlexandria where he was the chief librarian. (At the time, Alexandria was famous forits library.) Eratosthenes was also famous for estimating the circumference of the earthusing elementary trigonometry (i.e. geometry) and the lengths of shadows in two differentplaces (measured at the same time of day.)

    Example 6.2.1.1. Lets use the Sieve of Eratosthenes to find all the primes less than or equalto 30. Below is the list of numbers from 1 to 30, after the method has been applied.

    6 1 2 3 64 5 66 7 68 69 61011 612 13 614 615 616 17 618 19 620621 622 23 624 625 626 627 628 29 630

    The following are the steps required to obtain this.

    1. List natural numbers from 1 upto 30.

    2. Cross out 1.

    3. The first number not crossed out is 2; box it and cross out 4, 6, 8, 10, 12, 14, 16, 18, 20,22, 24, 26, 28, 30 (all multiples of 2 other than 2 itself in the list).

    4. The first number not crossed out or boxed is now 3; box it and cross out 9, 15, 21, 27(all multiples of 3 other than 3 itself in the list; 6, 12, 18, 24, 30 are also multiples of3 but have already been crossed out).

    5. The first number not crossed out or boxed is now 5; box it and cross out 25 (the onlymultiple of 5 left that hasnt already been crossed out or boxed; 10, 15, 20, 30 are alsomultiples of 5 but have already been crossed out).On further repeats of Step 4. we box 7, 11, 13, 17, 19, 23, 29 . . . it turns out that on eachof these occasions there are no multiples left to cross out.

    So the list of primes less than or equal to 30 is: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29.

  • 40 CHAPTER 6. NUMBER THEORY INTRODUCTION

    The Sieve of Eratosthenes quickly becomes a cumbersome way of discovering whether a giveninteger N is prime, as N increases. It is quite an impractical method for determining theprimality (i.e. whether prime or not) of an integer N when N is large. On the other hand it isrelatively easy to determine divisibility by any given number.

    Observations. 1. If n is composite then n = ab for some natural numbers a, b such thatneither a nor b is 1 or n; and either a = b =

    n or one of a or b is less than

    n. Thus,

    to show n is prime we need only show it has no prime divisors less than or equal ton.

    2. When performing the Sieve of Eratosthenes in Example 6.2.1.1 we observed in Step 5.that when we came to box 7, no further multiples of anything were left to cross out, andthe reason for this is that 7 >

    30.

    Example 6.2.1.2. 97 is prime, since

    2, 3, 5, 7 are the primes less than 10; 97 < 100 and 100 = 102 (we dont need to find square-roots exactly!); and none of 2, 3, 5, 7 divides 97.

  • 6.2. PRIME NUMBERS 41

    Exercise Set 6.

    1. Determine simple rules for divisibility by each of the following natural numbers:

    (i) 2

    (ii) 3

    (iii) 4

    (iv) 5

    (v) 6

    (vi) 8

    (vii) 9

    (viii) 10

    (ix) 11

    (x) 12

    (xi) 15

    Note: there is a rule for 7, but its complicated and it is not much better than straightdivision.

    2. The number 739ABC is divisible by 7, 8 and 9. What values can A, B and C take?

    3. Show that x2 y2 = 2 has no integer solutions.4. Prove that for every integer n:

    (i) 3 n3 n;(ii) 6 n(n 1)(2n 1);

    (iii) 30 n5 n;(iv) 120 n5 5n3 + 4n;

    (v) 4 - n2 + 2;(vi) 121 - n2 + 3n+ 5.

    5. Prove that for all integers a and b: 3 divides (a+ b)3 a3 b3.6. Is 167 prime?

    7. Show that if n = pe11 pe22 pekk is the prime decomposition of the positive integer n, then

    the number of divisors of n (including 1 and n) is (e1 + 1)(e2 + 1) (ek + 1).8. Which positive integers have exactly three positive divisors?

    9. Which positive integers have exactly four positive divisors?

    10. Show that a natural number n is an exact square if and only if it has an odd number ofdivisors.

    11. There are 50 prisoners in a row of locked cells. With the return of the King from theCrusades, a partial amnesty is declared and it works like this. When the prisoners arestill asleep, the jailer walks past the cells 50 times, each time walking from left to right.On the first pass, he turns the lock in every cell (so that every cell is now open). Onthe second pass he turns the lock on every second cell (meaning that these cells are nowlocked again). On the third pass, he turns the lock on every third cell, and so on. Ingeneral, on the kth pass, he turns the lock on every kth cell. The question is: which cellsare unlocked at the end of the process so that the prisoner is free to go?

    12. Is the following statement true or false? The number n2 + n+ 41 is prime for all positiveintegers n.

    13. Is the list of prime numbers finite? i.e. is there a largest prime number?

    14. Suppose p is prime.

    (i) Show that if p a3 then p a.

    (ii) Show that if p b and p a2 + b2 then p a.

  • 42 CHAPTER 6. NUMBER THEORY INTRODUCTION

  • CHAPTER 7

    Number Theory divisors and multiples

    Definition 7.1. The greatest common divisor (or highest common factor) of two integers a, b,written gcd(a, b) or hcf(a, b)(a, b) or just (a, b) is the largest natural number that divides botha and b. For example, (10, 16) = 2.

    Observe that, if d is any common divisor of a and b then d a bm, for any integer m.Conversely, any common divisor of abm and b, where m Z, is a divisor of a = (abm)+mb.So the set of common divisors of a and b is also the set of common divisors of a bm and b,for any m Z. In particular, this means that (a, b) = (a bm, b) for any integer m. This factis the central idea behind the Euclidean Algorithm (Algorithm 7.3).

    Definition 7.2. The lowest common multiple (or least common multiple) of a and b,written lcm(a, b), is the least natural number m such that a m and b m.

    It can be shown thatgcd(a, b) lcm(a, b) = |ab|.

    Below we introduce an efficient way of calculating the gcd of pairs of integers, that remainsuseful even when the integers are very large. The method well use is an old one.

    The Euclidean Algorithm

    Algorithm 7.3 (Euclidean Algorithm). To find gcd(a, b) where a and b are positive integers.Well assume that a b. The algorithm proceeds by finding pairs of integers (qi, ri) as follows:

    a = q1b+ r1, 0 r1 < bb = q2r1 + r2, 0 r2 < r1r1 = q3r2 + r3, 0 r3 < r2

    ...

    rk = qk+2rk+1 + rk+2, 0 rk+2 < rk+1...

    The algorithm continues until rk+2 = 0, so that we finish with

    rn1 = qn+1rn,

    with rn+1 = 0, for some positive integer n.We will see later that being able to trace the algorithm backwards is just as valuable as obtaininggcd(a, b). In doing so, it will be useful to assign the labels:

    a = r1, b = r0.

    Theorem 7.4. When the Euclidean Algorithm terminates we have

    rn = (a, b).

    The assumption a b is actually unnecessary. If a < b one obtains q1 = 0, r1 = a, so that the first iterationeffectively swaps a and b. Thus a computer program does not need to (and for efficiency, should not) checkwhether or not a b.

    43

  • 44 CHAPTER 7. NUMBER THEORY DIVISORS AND MULTIPLES

    Proof. This follows from the observation we made after Definition 7.1, namely that (a, b) =(a bm) for any m Z. At step k + 2, we have

    rk+2 = rk qk+2rk+1,so that we have

    (a, b) = (r1, r0) = (r1, r0) = (r0, r1)

    = (r1, r2)

    ...

    = (rk, rk+1)

    ...

    = (rn1, rn)

    = (rn, rn+1) = (rn, 0) = rn.

    Hence the last non-zero remainder rn, of the Euclidean Algorithm, is (a, b), as claimed.

    Example 7.5. Find the greatest common divisor of 1547 and 560.We set a = 1547, b = 560. Then

    1547 = 2 560 + 427560 = 1 427 + 133427 = 3 133 + 28133 = 4 28 + 2128 = 1 21 + 721 = 3 7 + 0

    So (1547, 560) = 7.

    A convenient way to execute the algorithm that helps one keep track of things is via adivision table. We demonstrate this technique below, redoing the above example:

    1547 5602 1120 427 1

    427 1333 399 112 4

    28 211 21 21 3

    7 0

    Remark 7.6. Observe that for each i we have ri+2 < ri. So the algorithm finishes fairly quickly.

    Theorem 7.7. If (a, b) = d then there exist integers x and y such that

    d = xa+ yb.

    Proof. Tracing the Euclidean Algorithm backwards, we have that rn is a linear combinationof rn1 and rn2:

    rn = rn2 qnrn1.Substituting for rn1, using the previous step of the Euclidean Algorithm, one has rn as alinear combination of rn2 and rn3. Continuing in this way, one eventually has rn as a linearcombination of r1 = a and r0 = b. (See the final remark of the description of Algorithm 7.3.)

  • 45

    We demonstrate the procedure, using the pair a = 1547, b = 560 from the previous example:

    7 = 28 1 21= 28 1(133 4 28)= 5 28 133= 5 (427 3 133) 133= 5 427 16 133= 5 427 16 (560 427)= 21 427 16 560= 21 (1547 2 560) 16 560= 21 1547 58 560.

    So (1547, 560) = 1547x+ 560y with x = 21 and y = 58.

    Remark 7.8. In Theorem 7.7, the pair of integers (x, y) is not unique, for suppose (x0, y0)satisfies

    d = ax+ by, (7.1)

    then

    d = ax0 + by0

    = ax0 + ab+ by0 ab= a(x0 + b) + b(y0 a).

    Hence

    x = x0 + b, y = y0 a, (7.2)where Z, is a more general solution of (7.1). In fact, when d = (a, b) one can show (7.2) isthe most general solution of (7.1).

    Definition 7.9. An equation of form

    ax+ by = c, (7.3)

    where x, y are unknown integers is a linear Diophantine equation.Exercise. Show that (7.3) has solutions if and only if gcd(a, b) c.

    Definition 7.10. If (a, b) = 1 then a and b are relatively prime (or coprime).

    Corollary 7.11. Integers a and b are relatively prime if and only if x, y Z such that

    ax+ by = 1.

    Proof. The only if part is immediate from Theorem 7.7. In the other direction, supposethat (a, b) = d and for a contradiction suppose that d > 1. Then since d ax + by we can nothave ax+ by = 1.

  • 46 CHAPTER 7. NUMBER THEORY DIVISORS AND MULTIPLES

    Extended Euclidean Algorithm

    By reorganising our division table, and doing a few extra calculations on the forward traceof the Euclidean Algorithm, we can obtain coefficients x, y such that d = (a, b) and

    ax+ by = d.

    The table is organised with the following column headings:

    i xi yi ri qi

    Defining a = r1, b = r0 and qi and ri as before, so that we have

    ri = ri2 qiri1, for i 1,we define the xi and yi to satisfy the same relation as ri, i.e.

    xi = xi2 qixi1yi = yi2 qiyi1

    for i 1. As with the ri, in order to be able to start, we must define x1, x0, y1, y0. We definethese in such a way (and we show this below) that

    axi + byi = ri, for 1 i n,so that when i = n we have

    axn + byn = rn = d,

    i.e. the final line of the table has coefficients x = xn, y = yn satisfying

    ax+ by = d.

    Magic! The starting values for xi and yi are

    x1 = 1, x0 = 0, y1 = 0, y0 = 1.

    One can sometimes save a step by allowing negative remainders. Before proving the algorithmworks, let us demonstrate using our earlier example:

    i xi yi ri qi Comments1 1 0 1547

    0 0 1 5601 1 2 427 2 1547 2 560 = 427, 1 2 0 = 1, 0 2 1 = 22 1 3 133 1 560 1 427 = 133, 0 1 1 = 1, 1 1 2 = 33 4 11 28 3 427 3 133 = 28, 1 3 1 = 4, 2 3 3 = 114 21 58 7 5 133 5 28 = 7, 1 5 4 = 21, 3 5 11 = 58

    Observe that we may stop since 7 28. Thus from the last line of the table we have21 1547 + 58 560 = 7 21 1547 58 560 = 7.

  • 47

    Proof (of Extended Euclidean Algorithm). We need to prove the claim that

    axi + byi = ri, for 1 i n,given that each of xi, yi, ri satisfy the recurrence

    ui = ui2 qiui1, for i 1,and for i = 1, 0,

    x1 = 1, x0 = 0, y1 = 0, y0 = 1, r1 = a, r0 = b.

    Thus, defineP (i) : ri = axi + byi.

    We will prove P (i) for 1 i n by a (finite) induction by proving each of P (1), P (0),and P (k) and P (k + 1) = P (k + 2) for general k.

    For P (1), we haveLHS of P (1) = r1 = a

    = a 1 + b 0= a x1 + b y1 = RHS of P (1)

    So P (1) holds.For P (0), we have

    LHS of P (0) = r0 = b

    = a 0 + b 1= a x0 + b y0 = RHS of P (0)

    So P (0) holds.Now we show P (k) and P (k + 1) = P (k + 2), for general k.

    So assume P (k) and P (k + 1), i.e.

    rk = axk + byk

    rk+1 = axk+1 + byk+1

    and consider P (k + 2):

    LHS of P (k + 2) = rk+2

    = rk qk+2rk+1, by the given recurrence= axk + byk qk+2(axk+1 + byk+1), by the inductive assumption= a(xk qk+2xk+1) + b(yk qk+2yk+1)= axk+2 + byk+2, by the given recurrence

    = RHS of P (k + 2)

    So we have shown that P (k) and P (k + 1) = P (k + 2).So the induction is complete and the claim

    axi + byi = ri, for 1 i n,is proved.

  • 48 CHAPTER 7. NUMBER THEORY DIVISORS AND MULTIPLES

    Lemma 7.12. If S(n) is the sum of the digits of n then

    n S(n) (mod 3)and

    n S(n) (mod 9).Proof. Let (akak1 . . . a1a0) be the decimal representation of n, and observe that 10 is congru-ent to 1 modulo each of 3 or 9. Then

    n =k`=0

    a`10`

    k`=0

    a`1` (mod 3)

    k`=0

    a` (mod 3).

    Butk

    `=0 a` = S(n). The argument is identical if (mod 3) is replaced by (mod 9).

    Corollary 7.13. Let S(n) be the sum of the digits of n. Then

    (i) 3 n 3 S(n); and(ii) 9 n 9 S(n).

    Lemma 7.14. Let (akak1 . . . a1a0) be the decimal representation of n and letA(n) =k

    `=0(1)`a`be the alternating sum of the digits of n. Then

    11 n 11 A(n).Remark 7.15. One usually describes A(n) of Lemma 7.14 as the difference of the sums ofthe even-place and odd-place digits . It is proved by observing that 11 1 (mod 10) andfollowing the same general idea as the previous lemma.

    Theorem 7.16 (Chinese Remainder Theorem). If m1,m2, . . . ,mk N are pairwise relativelyprime, i.e. (mi,mj) = 1 for i 6= j, then the k simultaneous congruences

    x a1 (mod m1)x a2 (mod m2)

    ...

    x ak (mod mk)have a unique solution modulo M =

    ki=1mi.

    Moreover, the solution may be constructed as follows.

    Define Mi :=

    j 6=imj = M/mi, for i = 1, 2, . . . , k.

    Define bi to be the multiplicative inverse of Mi modulo mi, for each i, i.e.biMi 1 (mod mi), for i = 1, 2, . . . , k.

    (Since biMi 1 (mod mi) is equivalent to biMi + qmi = 1 for some integer q, and(mi,Mi) = 1, we can construct bi (and q) via the Euclidean Algorithm.)

    The solution is now given by

    x kj=1

    ajbjMj (mod M).

  • 49

    Proof. The solution above means that

    x =kj=1

    ajbjMj + qM

    for some integer q. Consider this expression modulo mi. Since mi Mj when j 6= i, biMi 1(mod mi), and mi M for all i, we have

    x =kj=1

    ajbjMj + qM

    =j 6=i

    ajbjMj + aibiMi + qM

    j 6=i

    ajbj 0 + ai 1 + q 0 (mod mi)

    ai (mod mi)i.e. the expression for x reduces to each of the given congruences. Hence the constructedexpression for x satisfies all the given congruences.

    Eulers Totient Function

    Definition 7.17. For a given natural number n, let the set S of natural numbers k < n thatare coprime to n, i.e.

    S = {k N | k < n and (k, n) = 1}.Then Eulers totient function (n) is defined to be the cardinality of S.

    Example 7.18. For n = 12, the set of natural numbers less than n is

    {1, 2, . . . , 11}.Eliminating all the elements that are divisible by 2 or 3 (the prime divisors of 12), we have

    S = {1, 5, 7, 11},and so

    (12) = |S| = 4.One of the main applications of Eulers totient function is the following generalisation of

    Fermats Little Theorem.

    Theorem 7.19 (Euler). If a Z, n N and (a, n) = 1, thena(n) 1 (mod n).

    Proof. If one knows a little Group Theory, this result follows from observing that the setdefined at the beginning of the section forms a group under multiplication modulo n. Thena well-known theorem (to Group Theorists), Lagranges Theorem gives us immediately

    a|S| 1 (mod n),and the result follows.

    Example 7.20. We have (3, 8) = 1 and since S = {1, 3, 5, 7} is the set of natural numbers lessthan 8 that are coprime to 8, we have (8) = |S| = 4.Thus Eulers Theorem tells us 34 1 (mod 8), and indeed we have: 34 = 81 1 (mod 8).

  • 50 CHAPTER 7. NUMBER THEORY DIVISORS AND MULTIPLES

    We now obtain a formula for (m), which depends on two essential properties:

    (i) (pk) = pk pk1, if k N and p is prime;(ii) is a multiplicative function (we define what this means below, but we wont bother to

    prove it).

    Definition 7.21. A function f : N N is said to be multiplicative if for a, b N,(a, b) = 1 = f(ab) = f(a)f(b).

    Theorem 7.22. is multiplicative, i.e. if m1,m2 N then(m1m2) = (m1)(m2).

    Example 7.23. Lets find (12) using the two properties:

    (12) = (3)(4), by property (ii), since (3, 4) = 1

    = (3 30)(22 21), by property (i), twice= 2 2 = 4

    as we observed before.

    The elements of S = {1, 2, . . . , p 1} are all coprime to p, if p is prime. So it followsimmediately that for a prime p, (p) = p 1. We can generalise this idea to get a proof ofproperty (i).

    Theorem 7.24. If n = pk where p is a prime and k N then

    (n) = pk pk1 = pk(p 1

    p

    ).

    Proof. Observe that for a number in {1, 2, . . . , pk} not to be coprime to n = pk, it must havep as a divisor. So the set S of natural numbers less than p that are coprime to n = pk can bewritten as

    S = {1, 2, . . . , pk} \ {pm | m {1, 2, . . . , pk1}}. (n) = |S| = pk pk1.

    Theorem 7.25. If N has prime factorisation

    N =ni=1

    pii

    then

    (N) = Nni=1

    pi 1pi

    .

    Proof. This follows by induction on n.

    Example 7.26. (180) = (22325) = 180(2 1

    2

    )(3 13

    )(5 15

    )= 48.

  • 51

    Exercise Set 7.

    1. For each of the following pairs of integers a, b use the Euclidean Algorithm to find d = (a, b)and find a pair of integers x, y such that ax+ by = d.

    (i) a = 85, b = 41; (ii) a = 2613, b = 637.

    2. Show that if there exist integers x, y such that ax+ by = 1 then (a, b) = 1.

    3. Show that (3k + 2, 5k + 3) = 1 for any integer k.

    4. Show that (a, a+ 2) = 2 if a is even and (a, a+ 2) = 1 otherwise.

    5. Show that if (a, b) = 1 then (a+ b, a b) = 1 or 2.6. Find all solutions to the following Diophantine Equations.

    (i) 2x+ 5y = 11. (ii) 12x+ 18y = 50. (iii) 202x+ 74y = 7638.

    Does equation (iii) have a solution in positive integers x, y?

    7. A grocer orders apples and oranges at a total cost of $8.39. If apples cost 25c each andoranges cost 18c each, how many of each type of fruit did the grocer order?

    8. An apartment block has units at two rates: most rent at $87/week, but a few rent at$123/week. When all are rented the gross income is $8733/week. How many units of eachtype are there?

    9. When Jane is one year younger than Betty will be when Jane is half as old as Betty willbe when Jane is twice as old as Betty is now, Betty will be three times as old as Janewas when Betty was as old as Jane is now.One is in her teens and ages are in completed years. How old are they?

  • 52 CHAPTER 7. NUMBER THEORY DIVISORS AND MULTIPLES

  • CHAPTER 8

    Number Theory congruences

    Congruence modulo m

    Suppose m N. Then for two integers a, b we say:

    a is congruent to b modulo m(written: a b (mod m) )

    if and only if

    a and b give the same remainder on division by m,(in which case: m a b ).

    The reason that looks so much like =, is that it behaves very much like = does betweenintegers. In particular, congruence modulo m has the following properties.

    if a b (mod m) and b c (mod m) then a c (mod m).

    This property is called transitivity. if a b (mod m) and c d (mod m) then

    a+ c b+ d (mod m)a c b d (mod m)

    if a b (mod m) and n is a natural number then

    an bn (mod m).

    This follows from the previous (multiplication) property, since, if a b (mod m) then

    an a a a (mod m) b b b (mod m) bn (mod m)

    Also like = the problem: ax b (mod m) where a, b are known integers and x isthe unknown, need not have solutions for x.

    53

  • 54 CHAPTER 8. NUMBER THEORY CONGRUENCES

    Example 8.1.

    (i) 6 1 (mod 5) and 11 1 (mod 5). So 6 11 (mod 5). In fact, the integers n such thatn 1 (mod 5) are precisely those integers that can be written in the form:

    5k + 1

    for some integer k. In fact, if k is an integer then

    n = 5k if and only if n 0 (mod 5)n = 5k + 1 if and only if n 1 (mod 5)n = 5k + 2 if and only if n 2 (mod 5)n = 5k + 3 if and only if n 3 (mod 5)n = 5k + 4 if and only if n 4 (mod 5)

    (ii) 7 1 (mod 6) and 231 3 (mod 6). So

    7 + 231 1 + 3 (mod 6) 4 (mod 6); and

    7.231 1 3 (mod 6) 3 (mod 6).

    We have seen that addition and multiplication modulo m, behaves just like we might expect.Similarly, subtraction is just as one would expect. What about division? Here some care isneeded:

    Lemma 1. If ac bc (mod m) and (c,m) = 1 then a b (mod m).

    Lemma 2. If ac bc (mod m) and (c,m) = d then a b (mod m/d).

    Summary of Divisibility and Congruence

    The following statements are equivalent (i.e. mean the same thing), where m is a naturalnumber and b is an integer.

    m divides b.

    m b.

    b = mq for some integer q.

    b is congruent to 0 modulo m.

    b 0 (mod m).

  • 55

    The following statements are equivalent where m is a natural number and b, r are integers.

    m divides b r. m b r. b = mq + r for some integer q. b is congruent to r modulo m. b r (mod m).

    Fermats Little Theorem. If n N, p is a prime and p - n then np1 1 (mod p).Proof. Suppose r is an integer such that 0 < r < p. Then rn s (mod p) for some integers also satisfying 0 < s < p (since rn 0 (mod p) would imply p n contrary to assumption).Furthermore, for distinct values of r we obtain different values of s, since if

    r1n s (mod p) and r2n s (mod p),

    then r1n r2n (mod p) whence r1 = r2 by Lemma 1. Hence

    1n 2n 3n (p 1)n 1 2 3 (p 1) (mod p)

    which on cancellation (using Lemma 1) gives

    np1 1 (mod p).

    Corollary. If n N, p is a prime then np n (mod p).Proof. If p - n then the result follows from Fermats Little Theorem by multiplying both sidesof the congruence by n. Otherwise n 0 (mod p), in which case the result is trivially true.

  • 56 CHAPTER 8. NUMBER THEORY CONGRUENCES

    Exercise Set 8.

    1. Solve the adjacent alphametic (an additionin which: each letter stands for a differentdigit; and left-most digits of a number arenot allowed to be 0).

    A H AA H A

    AW A G

    H A H A

    Answer. HAHA = 1717 (W = 2, G = 6). The solution is unique.

    2. About all we know of Diophantus life is his epitaph from which his age at death is to bededuced:

    Diophantus spent one-sixth of his life in childhood, one-twelfth in youth, andanother one-seventh in bachelorhood. A son was born five years after his mar-riage and died four years before his father at half his fathers age.

    3. Augustus de Morgan, a nineteenth-century mathematician, stated:

    I was x years old in the year x2.

    When was he born?

    4. Prove that for every integer n:

    (i) 3 n3 n;(ii) 5 n5 n;

    (iii) 7 n7 n;(iv) 11 n11 n.

    Show that n9 n is not necessarily divisible by 9. Hint: Try n = 2.What general result is suggested by the above?

    5. Prove that 36n 26n is divisible by 35, for every positive integer n.

    6. What is the final digit of 777777

    7

    .

    7. Prove that for any natural number n that

    17 divides 2n.32n 1.

    8. Prove that for any natural number n

    17n 12n 24n + 19n

    is divisible by 35.

    9. Using Fermats Little Theorem, prove that for all positive integers a and b:

    (i) 3 divides (a+ b)3 a3 b3;(ii) 5 divides (a+ b)5 a5 b5.

    Can you generalise these results?

  • 57

    10. Prove that 599 + 1199 + 1799 is divisible by 33.11. What is the final digit of ((((((((((77)7)7)7)7)7)7)7)7)7)? (7 occurs as a power 10 times.)12. (17th International Olympiad, 1975, Problem 4) When 44444444 is written in decimal

    notation, the sum of its digits is A. Let B be the sum of the digits of A. Find the sumof the digits of B.Hints: First show that the sum of the digits of B is fairly small (in fact: less than 16).Then use the fact that, for any natural number N ,

    N (sum of the digits of N) (mod 9).

    13. Obtain a complete list of primes less than 1000.[Hint. There are 168 of them!]

    Answer. Using the Sieve of Eratosthenes, the primes less than 1000 are:2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83,89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173,179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269,271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373,379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467,479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593,599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691,701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821,823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937,941, 947, 953, 967, 971, 977, 983, 991, and 997.

    If you avoided this problem because you thought it would take too long, note that 322 >1000; so . . . once you have boxed 31 (the 11th prime) all remaining numbers not crossedout must be prime. (So you only need to run through the algorithm 11 times.)

    14. Show 7 22225555 + 55552222.

    15. Show Euclids Lemma is false if p is not prime.

    16. For which a does the congruence ax 1 (mod m) have a solution, when . . .

    (i) m = 4? (ii) m = 5? (iii) m = 6? (iv) m = 7?

    17. Solve 58x 1 (mod 127).[Hint. Use the Euclidean Algorithm as one of your steps.]

  • 58 CHAPTER 8. NUMBER THEORY CONGRUENCES

  • CHAPTER 9

    Number Theory cryptosystems

    Review

    Lets now look at expressing Property 1, Euclids Lemma and Fermats Little Theorem in termsof congruences, and remind ourselves of Lemmas 1 and 2.

    Property 1. If b 0 (mod a) and c 0 (mod a) then bm+ cn 0 (mod a).Euclids Lemma. If p is prime and ab 0 (mod p) then

    a 0 (mod p) or b 0 (mod p).

    Fermats Little Theorem. If p is prime and a 6 0 (mod p) then ap1 1 (mod p).Also, recall that two integers a, b are coprime if their greatest common divisor (a, b) is 1. Wealso saw the following two lemmas. Lemma 2 is, in fact, a generalisation of Lemma 1.

    Lemma 1. If ac bc (mod m) and (c,m) = 1 then a b (mod m).Lemma 2. If ac bc (mod m) and (c,m) = d then a b (mod m/d).

    Cryptosystems

    A code is an algorithm used to reformulate a message in a convenient form for transmission,e.g. the Morse code encodes a message as dots and dashes, convenient for transmission alonga wire. It was designed before it was discovered how to transmit voice messages. When oneencodes a message, one is not trying to keep the message secret.

    A cryptosystem is an algorithm used to encrypt a message to keep it secret. To describesome of these it will be useful to start with a numerical encoding of the alphabet and the blankspace between words:

    letter space A B C D E F G H I J K L M N O P Q R S T U V W X Y Zencoding 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26

    One of the simplest cryptosystems is the Caesar cipher which replaces each letter (withencoding u) of a message by the letter with encoding v, where:

    v au+ b (mod m)

    where a, b,m are fixed integers such that a and m are coprime and m is at least as large as thenumber of letters in your alphabet. For our alphabet above we would need m to be at least 27. The cipher is named for Julius Caesar who used such a cryptosystem with a = 1

    and b = 3. If we choose m = 27 with Julius Caesars choice for a and b encrypting amessage amounts to a cyclic shift of each letter right by 3 letters. This simple exampleis easy to break . . . by determining the encryption of just one letter of the message, bytrial-and-error (there are only 27 possibilities to check . . . and by picking on the mostfrequently occurring letter of the encrypted message we might try e first, etc.).

    59

  • 60 CHAPTER 9. NUMBER THEORY CRYPTOSYSTEMS

    Another simple cryptosystem is the one-time pad. The way this works is that both thereceiver and sender have a long sequence of random numbers, (b1, b2, . . . ). If a message withthe simple numerical encoding of the letters is:

    u1, u2, . . . , ui, . . .

    then the ith letter of the encoded message is encrypted as

    ui + bi (mod m),

    where m may be 27 if spaces are encoded or 26 if they are not encoded. Each sequence ofrandom numbers is used just once which makes the cryptosystem unbreakable. The methodis however extremely cumbersome, because both sender and receiver must keep a very longsequence of numbers.

    A one-time pad is used for the hot-line between Washington and Moscow.For frequent c