Number Theory Naoki Sato <sato@artofproblemsolving.com>



Similar documents
Number Theory Naoki Sato

As we have seen, there is a close connection between Legendre symbols of the form

SOME PROPERTIES OF EXTENSIONS OF SMALL DEGREE OVER Q. 1. Quadratic Extensions

CHAPTER 5. Number Theory. 1. Integers and Division. Discussion

U.C. Berkeley CS276: Cryptography Handout 0.1 Luca Trevisan January, Notes on Algebra

Continued Fractions and the Euclidean Algorithm

6.042/18.062J Mathematics for Computer Science December 12, 2006 Tom Leighton and Ronitt Rubinfeld. Random Walks

Homework until Test #2

Computer and Network Security

Number Theory Hungarian Style. Cameron Byerley s interpretation of Csaba Szabó s lectures

Revised Version of Chapter 23. We learned long ago how to solve linear congruences. ax c (mod m)

An Introductory Course in Elementary Number Theory. Wissam Raji

The cyclotomic polynomials

Lectures on the Dirichlet Class Number Formula for Imaginary Quadratic Fields. Tom Weston

Handout NUMBER THEORY

PUTNAM TRAINING POLYNOMIALS. Exercises 1. Find a polynomial with integral coefficients whose zeros include

SUM OF TWO SQUARES JAHNAVI BHASKAR

Overview of Number Theory Basics. Divisibility

Complex Conjugation and Polynomial Factorization

MOP 2007 Black Group Integer Polynomials Yufei Zhao. Integer Polynomials. June 29, 2007 Yufei Zhao

PRIME NUMBERS AND THE RIEMANN HYPOTHESIS

Introduction to NP-Completeness Written and copyright c by Jie Wang 1

Winter Camp 2011 Polynomials Alexander Remorov. Polynomials. Alexander Remorov

Chapter 4, Arithmetic in F [x] Polynomial arithmetic and the division algorithm.

k, then n = p2α 1 1 pα k

MATH 289 PROBLEM SET 4: NUMBER THEORY

Primality - Factorization

On the generation of elliptic curves with 16 rational torsion points by Pythagorean triples

TRANSCENDENTAL NUMBERS

Discrete Mathematics, Chapter 4: Number Theory and Cryptography

Number Theory: A Mathemythical Approach. Student Resources. Printed Version

Elementary Number Theory and Methods of Proof. CSE 215, Foundations of Computer Science Stony Brook University

= = 3 4, Now assume that P (k) is true for some fixed k 2. This means that

Math 453: Elementary Number Theory Definitions and Theorems

Unique Factorization

8 Primes and Modular Arithmetic

SUBGROUPS OF CYCLIC GROUPS. 1. Introduction In a group G, we denote the (cyclic) group of powers of some g G by

PROBLEM SET 6: POLYNOMIALS

Copy in your notebook: Add an example of each term with the symbols used in algebra 2 if there are any.

8 Divisibility and prime numbers

ABSTRACT ALGEBRA: A STUDY GUIDE FOR BEGINNERS

Section 4.2: The Division Algorithm and Greatest Common Divisors

Factoring Polynomials

a 11 x 1 + a 12 x a 1n x n = b 1 a 21 x 1 + a 22 x a 2n x n = b 2.

CONTINUED FRACTIONS AND FACTORING. Niels Lauritzen

Lecture 13 - Basic Number Theory.

Module MA3411: Abstract Algebra Galois Theory Appendix Michaelmas Term 2013

How To Solve The Prime Prime Prime Root Problem In Algebraic Theory

Precalculus Prerequisites a.k.a. Chapter 0. August 16, 2013

Notes on Factoring. MA 206 Kurt Bryan

CHAPTER SIX IRREDUCIBILITY AND FACTORIZATION 1. BASIC DIVISIBILITY THEORY

PYTHAGOREAN TRIPLES KEITH CONRAD

9. POLYNOMIALS. Example 1: The expression a(x) = x 3 4x 2 + 7x 11 is a polynomial in x. The coefficients of a(x) are the numbers 1, 4, 7, 11.

1 Gambler s Ruin Problem

How To Prove The Dirichlet Unit Theorem

A Course on Number Theory. Peter J. Cameron

Math Review. for the Quantitative Reasoning Measure of the GRE revised General Test

Die ganzen zahlen hat Gott gemacht

Factoring of Prime Ideals in Galois Extensions

The last three chapters introduced three major proof techniques: direct,

CONTINUED FRACTIONS AND PELL S EQUATION. Contents 1. Continued Fractions 1 2. Solution to Pell s Equation 9 References 12

it is easy to see that α = a

Today s Topics. Primes & Greatest Common Divisors

Some Polynomial Theorems. John Kennedy Mathematics Department Santa Monica College 1900 Pico Blvd. Santa Monica, CA

Lectures on Number Theory. Lars-Åke Lindahl

CS 103X: Discrete Structures Homework Assignment 3 Solutions

Kevin James. MTHSC 412 Section 2.4 Prime Factors and Greatest Comm

Cryptography and Network Security Number Theory

QUADRATIC RECIPROCITY IN CHARACTERISTIC 2

11 Ideals Revisiting Z

Factoring Algorithms

Algebra & Number Theory. A. Baker

Pythagorean Triples and Rational Points on the Unit Circle

Elementary Number Theory

3 1. Note that all cubes solve it; therefore, there are no more

RESULTANT AND DISCRIMINANT OF POLYNOMIALS

Modern Algebra Lecture Notes: Rings and fields set 4 (Revision 2)

Elementary Number Theory: Primes, Congruences, and Secrets

A number field is a field of finite degree over Q. By the Primitive Element Theorem, any number

Continued Fractions. Darren C. Collins

I. GROUPS: BASIC DEFINITIONS AND EXAMPLES

Chapter 3. if 2 a i then location: = i. Page 40

More Properties of Limits: Order of Operations

Quotient Rings and Field Extensions

Settling a Question about Pythagorean Triples

Doug Ravenel. October 15, 2008

Factorization Algorithms for Polynomials over Finite Fields

A Second Course in Mathematics Concepts for Elementary Teachers: Theory, Problems, and Solutions

Integer roots of quadratic and cubic polynomials with integer coefficients

A Modified Measure of Covert Network Performance

Lecture 3: Finding integer solutions to systems of linear equations

MATH 537 (Number Theory) FALL 2016 TENTATIVE SYLLABUS

Applications of Fermat s Little Theorem and Congruences

Coin ToGa: A Coin-Tossing Game

MATRIX ALGEBRA AND SYSTEMS OF EQUATIONS. + + x 2. x n. a 11 a 12 a 1n b 1 a 21 a 22 a 2n b 2 a 31 a 32 a 3n b 3. a m1 a m2 a mn b m

The Chinese Remainder Theorem

Introduction to Finite Fields (cont.)

PROOFS BY DESCENT KEITH CONRAD

Transcription:

Number Theory Naoki Sato <sato@artofroblemsolving.com> 0 Preface This set of notes on number theory was originally written in 1995 for students at the IMO level. It covers the basic background material that an IMO student should be familiar with. This text is meant to be a reference, and not a relacement but rather a sulement to a number theory textbook; several are given at the back. Proofs are given when aroriate, or when they illustrate some insight or imortant idea. The roblems are culled from various sources, many from actual contests and olymiads, and in general are very difficult. The author welcomes any corrections or suggestions. 1 Divisibility For integers a and b, we say that a divides b, or that a is a divisor (or factor) of b, or that b is a multile of a, if there exists an integer c such that b = ca, and we denote this by a b. Otherwise, a does not divide b, and we denote this by a b. A ositive integer is a rime if the only divisors of are 1 and. If k a and k+1 a where is a rime, i.e. k is the highest ower of dividing a, then we denote this by k a. Useful Facts If a, b > 0, and a b, then a b. If a b 1, a b 2,..., a b n, then for any integers c 1, c 2,..., c n, a n b i c i. i=1 Theorem 1.1. The Division Algorithm. For any ositive integer a and integer b, there exist unique integers q and r such that b = qa + r and 0 r < a, with r = 0 iff a b. 1

Theorem 1.2. The Fundamental Theorem of Arithmetic. Every integer greater than 1 can be written uniquely in the form e 1 1 e 2 2 e k k, where the i are distinct rimes and the e i are ositive integers. Theorem 1.3. (Euclid) There exist an infinite number of rimes. Proof. Suose that there are a finite number of rimes, say 1, 2,..., n. Let N = 1 2 n + 1. By the fundamental theorem of arithmetic, N is divisible by some rime. This rime must be among the i, since by assumtion these are all the rimes, but N is seen not to be divisible by any of the i, contradiction. Examle 1.1. Let x and y be integers. Prove that 2x + 3y is divisible by 17 iff 9x + 5y is divisible by 17. Solution. 17 (2x + 3y) 17 [13(2x + 3y)], or 17 (26x + 39y) 17 (9x + 5y), and conversely, 17 (9x + 5y) 17 [4(9x + 5y)], or 17 (36x + 20y) 17 (2x + 3y). Examle 1.2. Find all ositive integers d such that d divides both n 2 +1 and (n + 1) 2 + 1 for some integer n. Solution. Let d (n 2 + 1) and d [(n + 1) 2 + 1], or d (n 2 + 2n + 2). Then d [(n 2 + 2n + 2) (n 2 + 1)], or d (2n + 1) d (4n 2 + 4n + 1), so d [4(n 2 +2n+2) (4n 2 +4n+1)], or d (4n+7). Then d [(4n+7) 2(2n+1)], or d 5, so d can only be 1 or 5. Taking n = 2 shows that both of these values are achieved. Examle 1.3. Suose that a 1, a 2,..., a 2n are distinct integers such that the equation (x a 1 )(x a 2 ) (x a 2n ) ( 1) n (n!) 2 = 0 has an integer solution r. Show that so (1984 IMO Short List) r = a 1 + a 2 + + a 2n. 2n Solution. Clearly, r a i for all i, and the r a i are 2n distinct integers, (r a 1 )(r a 2 ) (r a 2n ) (1)(2) (n)( 1)( 2) ( n) = (n!) 2, 2

with equality iff {r a 1, r a 2,..., r a 2n } = {1, 2,..., n, 1, 2,..., n}. Therefore, this must be the case, so (r a 1 ) + (r a 2 ) + + (r a 2n ) = 2nr (a 1 + a 2 + + a 2n ) = 1 + 2 + + n + ( 1) + ( 2) + + ( n) = 0 r = a 1 + a 2 + + a 2n. 2n Examle 1.4. Let 0 < a 1 < a 2 < < a mn+1 be mn + 1 integers. Prove that you can select either m + 1 of them no one of which divides any other, or n + 1 of them each dividing the following one. (1966 Putnam Mathematical Cometition) Solution. For each i, 1 i mn + 1, let n i be the length of the longest sequence starting with a i and each dividing the following one, among the integers a i, a i+1,..., a mn+1. If some n i is greater than n then the roblem is solved. Otherwise, by the igeonhole rincile, there are at least m + 1 values of n i that are equal. Then, the integers a i corresonding to these n i cannot divide each other. Useful Facts Bertrand s Postulate. For every ositive integer n, there exists a rime such that n 2n. Gauss s Lemma. If a olynomial with integer coefficients factors into two olynomials with rational coefficients, then it factors into two olynomials with integer coefficients. Problems 1. Let a and b be ositive integers such that a b 2, b 2 a 3, a 3 b 4, b 4 a 5,.... Prove that a = b. 2. Let a, b, and c denote three distinct integers, and let P denote a olynomial having all integral coefficients. Show that it is imossible that P (a) = b, P (b) = c, and P (c) = a. (1974 USAMO) 3

3. Show that if a and b are ositive integers, then ( a + 1 n ( + b + 2) 1 ) n 2 is an integer for only finitely many ositive integers n. (A Problem Seminar, D.J. Newman) 4. For a ositive integer n, let r(n) denote the sum of the remainders when n is divided by 1, 2,..., n resectively. Prove that r(k) = r(k 1) for infinitely many ositive integers k. (1981 Kürschák Cometition) 5. Prove that for all ositive integers n, 0 < n k=1 g(k) k 2n 3 < 2 3, where g(k) denotes the greatest odd divisor of k. (1973 Austrian Mathematics Olymiad) 6. Let d be a ositive integer, and let S be the set of all ositive integers of the form x 2 + dy 2, where x and y are non-negative integers. (a) Prove that if a S and b S, then ab S. (b) Prove that if a S and S, such that is a rime and a, then a/ S. (c) Assume that the equation x 2 + dy 2 = has a solution in nonnegative integers x and y, where is a given rime. Show that if d 2, then the solution is unique, and if d = 1, then there are exactly two solutions. 2 GCD and LCM The greatest common divisor of two ositive integers a and b is the greatest ositive integer that divides both a and b, which we denote by gcd(a, b), and similarly, the lowest common multile of a and b is the least ositive 4

integer that is a multile of both a and b, which we denote by lcm(a, b). We say that a and b are relatively rime if gcd(a, b) = 1. For integers a 1, a 2,..., a n, gcd(a 1, a 2,..., a n ) is the greatest ositive integer that divides all of a 1, a 2,..., a n, and lcm(a 1, a 2,..., a n ) is defined similarly. Useful Facts For all a, b, gcd(a, b) lcm(a, b) = ab. For all a, b, and m, gcd(ma, mb) = m gcd(a, b) and lcm(ma, mb) = mlcm(a, b). If d gcd(a, b), then ( a gcd d, b ) = d gcd(a, b). d In articular, if d = gcd(a, b), then gcd(a/d, b/d) = 1; that is, a/d and b/d are relatively rime. If a bc and gcd(a, c) = 1, then a b. For ositive integers a and b, if d is a ositive integer such that d a, d b, and for any d, d a and d b imlies that d d, then d = gcd(a, b). This is merely the assertion that any common divisor of a and b divides gcd(a, b). If a 1 a 2 a n is a erfect k th ower and the a i are airwise relatively rime, then each a i is a erfect k th ower. Any two consecutive integers are relatively rime. Examle 2.1. Show that for any ositive integer N, there exists a multile of N that consists only of 1s and 0s. Furthermore, show that if N is relatively rime to 10, then there exists a multile that consists only of 1s. Solution. Consider the N + 1 integers 1, 11, 111,..., 111...1 (N + 1 1s). When divided by N, they leave N + 1 remainders. By the igeonhole rincile, two of these remainders are equal, so the difference in the corresonding integers, an integer of the form 111...000, is divisible by N. If N is relatively rime to 10, then we may divide out all owers of 10, to obtain an integer of the form 111...1 that remains divisible by N. 5

Theorem 2.1. For any ositive integers a and b, there exist integers x and y such that ax + by = gcd(a, b). Furthermore, as x and y vary over all integers, ax + by attains all multiles and only multiles of gcd(a, b). Proof. Let S be the set of all integers of the form ax+by, and let d be the least ositive element of S. By the division algorithm, there exist integers q and r such that a = qd + r, 0 r < d. Then r = a qd = a q(ax + by) = (1 qx)a (qy)b, so r is also in S. But r < d, so r = 0 d a, and similarly, d b, so d gcd(a, b). However, gcd(a, b) divides all elements of S, so in articular gcd(a, b) d d = gcd(a, b). The second art of the theorem follows. Corollary 2.2. The ositive integers a and b are relatively rime iff there exist integers x and y such that ax + by = 1. Corollary 2.3. For any ositive integers a 1, a 2,..., a n, there exist integers x 1, x 2,..., x n, such that a 1 x 1 +a 2 x 2 + +a n x n = gcd(a 1, a 2,..., a n ). Corollary 2.4. Let a and b be ositive integers, and let n be an integer. Then the equation ax + by = n has a solution in integers x and y iff gcd(a, b) n. If this is the case, then all solutions are of the form ( (x, y) = x 0 + t b d, y 0 t a ), d where d = gcd(a, b), (x 0, y 0 ) is a secific solution of ax + by = n, and t is an integer. Proof. The first art follows from Theorem 2.1. For the second art, as stated, let d = gcd(a, b), and let (x 0, y 0 ) be a secific solution of ax + by = n, so that ax 0 + by 0 = n. If ax + by = n, then ax + by ax 0 by 0 = a(x x 0 ) + b(y y 0 ) = 0, or a(x x 0 ) = b(y 0 y), and hence (x x 0 ) a d = (y 0 y) b d. Since a/d and b/d are relatively rime, b/d must divide x x 0, and a/d must divide y 0 y. Let x x 0 = tb/d and y 0 y = ta/d. This gives the solutions described above. 6

Examle 2.2. Prove that the fraction 21n + 4 14n + 3 is irreducible for every ositive integer n. (1959 IMO) Solution. For all n, 3(14n + 3) 2(21n + 4) = 1, so the numerator and denominator are relatively rime. Examle 2.3. For all ositive integers n, let T n = 2 2n + 1. Show that if m n, then T m and T n are relatively rime. Solution. We have that T n 2 = 2 2n 1 = 2 2n 1 2 1 = (T n 1 1) 2 1 = T 2 n 1 2T n 1 = T n 1 (T n 1 2) = T n 1 T n 2 (T n 2 2) = = T n 1 T n 2 T 1 T 0 (T 0 2) = T n 1 T n 2 T 1 T 0, for all n. Therefore, any common divisor of T m and T n must divide 2. But each T n is odd, so T m and T n are relatively rime. Remark. It immediately follows from this result that there are an infinite number of rimes. The Euclidean Algorithm. By recursive use of the division algorithm, we may find the gcd of two ositive integers a and b without factoring either, and the x and y in Theorem 2.1 (and so, a secific solution in Corollary 2.4). For examle, for a = 329 and b = 182, we comute 329 = 1 182 + 147, 182 = 1 147 + 35, 147 = 4 35 + 7, 35 = 5 7, and sto when there is no remainder. The last dividend is the gcd, so in our examle, gcd(329,182) = 7. Now, working through the above equations 7

backwards, 7 = 147 4 35 = 147 4 (182 1 147) = 5 147 4 182 = 5 (329 182) 4 182 = 5 329 9 182. Remark. The Euclidean algorithm also works for olynomials. Examle 2.4. Let n be a ositive integer, and let S be a subset of n + 1 elements of the set {1, 2,..., 2n}. Show that (a) There exist two elements of S that are relatively rime, and (b) There exist two elements of S, one of which divides the other. Solution. (a) There must be two elements of S that are consecutive, and thus, relatively rime. (b) Consider the greatest odd factor of each of the n + 1 elements in S. Each is among the n odd integers 1, 3,..., 2n 1. By the igeonhole rincile, two must have the same greatest odd factor, so they differ (multilication-wise) by a ower of 2, and so one divides the other. Examle 2.5. The ositive integers a 1, a 2,..., a n are such that each is less than 1000, and lcm(a i, a j ) > 1000 for all i, j, i j. Show that n i=1 1 a i < 2. (1951 Russian Mathematics Olymiad) Solution. If 1000 < a 1000, then the m multiles a, 2a,..., ma do m+1 m not exceed 1000. Let k 1 the number of a i in the interval ( 1000, 1000], k 2 2 in ( 1000, 1000], etc. Then there are k 3 2 1 + 2k 2 + 3k 3 + integers, no greater than 1000, that are multiles of at least one of the a i. But the multiles are distinct, so k 1 + 2k 2 + 3k 3 + < 1000 2k 1 + 3k 2 + 4k 3 + = (k 1 + 2k 2 + 3k 3 + ) + (k 1 + k 2 + k 3 + ) < 1000 + n < 2000. 8

Therefore, n i=1 1 2 k 1 a i 1000 + k 2 3 1000 + k 3 = 2k 1 + 3k 2 + 4k 3 + 1000 < 2. 4 1000 + Note: It can be shown that n 500 as follows: Consider the greatest odd divisor of a 1, a 2,..., a 1000. Each must be distinct; otherwise, two differ, multilication-wise, by a ower of 2, which means one divides the other, contradiction. Also, there are only 500 odd numbers between 1 and 1000, from which the result follows. It also then follows that Useful Facts n i=1 1 a i < 3 2. Dirichlet s Theorem. If a and b are relatively rime ositive integers, then the arithmetic sequence a, a + b, a + 2b,..., contains infinitely many rimes. Problems 1. The symbols (a, b,..., g) and [a, b,..., g] denote the greatest common divisor and lowest common multile, resectively of the ositive integers a, b,..., g. Prove that (1972 USAMO) [a, b, c] 2 [a, b][a, c][b, c] = (a, b, c) 2 (a, b)(a, c)(b, c). 2. Show that gcd(a m 1, a n 1) = a gcd(m,n) 1 for all ositive integers a > 1, m, n. 9

3. Let a, b, and c be ositive integers. Show that lcm(a, b, c) = abc gcd(a, b, c) gcd(a, b) gcd(a, c) gcd(b, c). Exress gcd(a, b, c) in terms of abc, lcm(a, b, c), lcm(a, b), lcm(a, c), and lcm(b, c). Generalize. 4. Let a, b be odd ositive integers. Define the sequence (f n ) by utting f 1 = a, f 2 = b, and by letting f n for n 3 be the greatest odd divisor of f n 1 + f n 2. Show that f n is constant for n sufficiently large and determine the eventual value as a function of a and b. (1993 USAMO) 5. Let n a 1 > a 2 > > a k be ositive integers such that lcm(a i, a j ) n for all i, j. Prove that ia i n for i = 1, 2,..., k. 3 Arithmetic Functions There are several imortant arithmetic functions, of which three are resented here. If the rime factorization of n > 1 is e 1 1 e 2 2 e k k, then the number of ositive integers less than n, relatively rime to n, is ) ) ) φ(n) = (1 (1 11 12 (1 1k n the number of divisors of n is = e 1 1 1 e 2 1 2 e k 1 k ( 1 1)( 2 1) ( k 1), and the sum of the divisors of n is τ(n) = (e 1 + 1)(e 2 + 1) (e k + 1), σ(n) = ( e 1 1 + e 1 1 1 + + 1)( e 2 2 + e 2 1 2 + + 1) ( e k + e k 1 ( e 1 +1 = k 1 1 1 1 k + + 1) ) ( e 2 +1 2 1 2 1 ) ( e k +1 k 1 k 1 Also, φ(1), τ(1), and σ(1) are defined to be 1. We say that a function f is multilicative if f(mn) = f(m)f(n) for all relatively rime ositive 10 ).

integers m and n, and f(1) = 1 (otherwise, f(1) = 0, which imlies that f(n) = 0 for all n). Theorem 3.1. The functions φ, τ, and σ are multilicative. Hence, by taking the rime factorization and evaluating at each rime ower, the formula above are found easily. Examle 3.1. Find the number of solutions in ordered airs of ositive integers (x, y) of the equation where n is a ositive integer. Solution. From the given, 1 x + 1 y = 1 n, 1 x + 1 y = 1 n xy = nx + ny (x n)(y n) = n2. If n = 1, then we immediately deduce the unique solution (2,2). For n 2, let n = e 1 1 e 2 2 e k k be the rime factorization of n. Since x, y > n, there is a 1-1 corresondence between the solutions in (x, y) and the factors of n 2, so the number of solutions is τ(n 2 ) = (2e 1 + 1)(2e 2 + 1) (2e k + 1). Examle 3.2. Let n be a ositive integer. Prove that φ(d) = n. d n Solution. For a divisor d of n, let S d be the set of all a, 1 a n, such that gcd(a, n) = n/d. Then S d consists of all elements of the form b n/d, where 0 b d, and gcd(b, d) = 1, so S d contains φ(d) elements. Also, it is clear that each integer between 1 and n belongs to a unique S d. The result then follows from summing over all divisors d of n. Problems 1. Let n be a ositive integer. Prove that n n n τ(k) =. k k=1 11 k=1

2. Let n be a ositive integer. Prove that τ 3 (d) = τ(d) d n d n 3. Prove that if σ(n) = 2N + 1, then N is the square of an odd integer. (1976 Putnam Mathematical Cometition) 4 Modular Arithmetic For a ositive integer m and integers a and b, we say that a is congruent to b modulo m if m (a b), and we denote this by a b modulo m, or more commonly a b (mod m). Otherwise, a is not congruent to b modulo m, and we denote this by a b (mod m) (although this notation is not used often). In the above notation, m is called the modulus, and we consider the integers modulo m. Theorem 4.1. If a b and c d (mod m), then a + c b + d (mod m) and ac bd (mod m). Proof. If a b and c d (mod m), then there exist integers k and l such that a = b + km and c = d + lm. Hence, a + c = b + d + (k + l)m, so a + c b + d (mod m). Also, so ac bd (mod m). Useful Facts For all integers n, ac = bd + dkm + blm + klm 2 n 2 For all integers n, 0 n 2 4 1 = bd + (dk + bl + klm)m, { 0 1 } { if n is even, (mod 4) if n is odd. (mod 8) 2 if n 0 (mod 4), if n 2 (mod 4), if n 1 (mod 2).. 12

If f is a olynomial with integer coefficients and a b (mod m), then f(a) f(b) (mod m). If f is a olynomial with integer coefficients of degree n, not identically zero, and is a rime, then the congruence f(x) 0 (mod ) has at most n solutions modulo, counting multilicity. Examle 4.1. Prove that the only solution in rational numbers of the equation x 3 + 3y 3 + 9z 3 9xyz = 0 is x = y = z = 0. (1983 Kürschák Cometition) Solution. Suose that the equation has a solution in rationals, with at least one non-zero variable. Since the equation is homogeneous, we may obtain a solution in integers (x 0, y 0, z 0 ) by multilying the equation by the cube of the lowest common multile of the denominators. Taking the equation modulo 3, we obtain x 3 0 0 (mod 3). Therefore, x 0 must be divisible by 3, say x 0 = 3x 1. Substituting, 27x 3 1 + 3y 3 0 + 9z 3 0 27x 1 y 0 z 0 = 0 y 3 0 + 3z 3 0 + 9x 3 1 9x 1 y 0 z 0 = 0. Therefore, another solution is (y 0, z 0, x 1 ). We may then aly this reduction recursively, to obtain y 0 = 3y 1, z 0 = 3z 1, and another solution (x 1, y 1, z 1 ). Hence, we may divide owers of 3 out of our integer solution an arbitrary number of times, contradiction. Examle 4.2. Does one of the first 10 8 +1 Fibonacci numbers terminate with 4 zeroes? Solution. The answer is yes. Consider the sequence of airs (F k, F k+1 ) modulo 10 4. Since there are only a finite number of different ossible airs (10 8 to be exact), and each air is deendent only on the revious one, this sequence is eventually eriodic. Also, by the Fibonacci relation, one can find the revious air to a given air, so this sequence is immediately eriodic. But F 0 0 (mod 10 4 ), so within 10 8 terms, another Fibonacci number divisible by 10 4 must aear. 13

In fact, a comuter check shows that 10 4 F 7500, and (F n ) modulo 10 4 has eriod 15000, which is much smaller than the uer bound of 10 8. If ax 1 (mod m), then we say that x is the inverse of a modulo m, denoted by a 1, and it is unique modulo m. Theorem 4.2. The inverse of a modulo m exists and is unique iff a is relatively rime to m. Proof. If ax 1 (mod m), then ax = 1+km for some k ax km = 1. By Corollary 2.2, a and m are relatively rime. Now, if gcd(a, m) = 1, then by Corollary 2.2, there exist integers x and y such that ax + my = 1 ax = 1 my ax 1 (mod m). The inverse x is unique modulo m, since if x is also an inverse, then ax ax 1 xax xax x x. Corollary 4.3. If is a rime, then the inverse of a modulo exists and is unique iff does not divide a. Corollary 4.4. If ak bk (mod m) and k is relatively rime to m, then a b (mod m). Proof. Multilying both sides by k 1, which exists by Theorem 4.2, yields the result. We say that a set {a 1, a 2,..., a m } is a comlete residue system modulo m if for all i, 0 i m 1, there exists a unique j such that a j i (mod m). Examle 4.3. Find all ositive integers n such that there exist comlete residue systems {a 1, a 2,..., a n } and {b 1, b 2,..., b n } modulo n for which {a 1 + b 1, a 2 + b 2,..., a n + b n } is also a comlete residue system. Solution. The answer is all odd n. First we rove necessity. For any comlete residue system {a 1, a 2,..., a n } modulo n, we have that a 1 + a 2 + + a n n(n + 1)/2 (mod n). So, if all three sets are comlete residue systems, then a 1 +a 2 + +a n +b 1 +b 2 + +b n n 2 +n 0 (mod n) and a 1 + b 1 + a 2 + b 2 + + a n + b n n(n + 1)/2 (mod n), so n(n + 1)/2 0 (mod n). The quantity n(n + 1)/2 is divisible by n iff (n + 1)/2 is an integer, which imlies that n is odd. Now assume that n is odd. Let a i = b i = i for all i. Then a i + b i = 2i for all i, and n is relatively rime to 2, so by Corollary 4.4, {2, 4,..., 2n} is a comlete residue system modulo n. Theorem 4.5. Euler s Theorem. If a is relatively rime to m, then a φ(m) 1 (mod m). 14

Proof. Let a 1, a 2,..., a φ(m) be the ositive integers less than m that are relatively rime to m. Consider the integers aa 1, aa 2,..., aa φ(m). We claim that they are a ermutation of the original φ(m) integers a i, modulo m. For each i, aa i is also relatively rime to m, so aa i a k for some k. Since aa i aa j a i a j (mod m), each a i gets taken to a different a k under multilication by a, so indeed they are ermuted. Hence, a 1 a 2 a φ(m) (aa 1 )(aa 2 ) (aa φ(m) ) a φ(m) a 1 a 2 a φ(m) 1 a φ(m) (mod m). Remark. This gives an exlicit formula for the inverse of a modulo m: a 1 a φ(m) 2 (mod m). Alternatively, one can use the Euclidean algorithm to find a 1 x as in the roof of Theorem 4.2. Corollary 4.6. Fermat s Little Theorem (FLT). If is a rime, and does not divide a, then a 1 1 (mod ). Examle 4.4. Show that if a and b are relatively rime ositive integers, then there exist integers m and n such that a m + b n 1 (mod ab). Solution. Let S = a m + b n, where m = φ(b) and n = φ(a). Then by Euler s Theorem, S b φ(a) 1 (mod a), or S 1 0 (mod a), and S a φ(b) 1 (mod b), or S 1 0 (mod b). Therefore, S 1 0, or S 1 (mod ab). Examle 4.5. For all ositive integers i, let S i be the sum of the roducts of 1, 2,..., 1 taken i at a time, where is an odd rime. Show that S 1 S 2 S 2 0 (mod ). Solution. First, observe that (x 1)(x 2) (x ( 1)) = x 1 S 1 x 2 + S 2 x 3 S 2 x + S 1. This olynomial vanishes for x = 1, 2,..., 1. But by Fermat s Little Theorem, so does x 1 1 modulo. Taking the difference of these two olynomials, we obtain another olynomial of degree 2 with 1 roots modulo, so it must be the zero olynomial, and the result follows from comaring coefficients. 15

Remark. We immediately have that ( 1)! S 1 1 (mod ), which is Wilson s Theorem. Also, x x 0 (mod ) for all x, yet we cannot comare coefficients here. Why not? Theorem 4.7. If is a rime and n is an integer such that (4n 2 + 1), then 1 (mod 4). Proof. Clearly, cannot be 2, so we need only show that 3 (mod 4). Suose = 4k + 3 for some k. Let y = 2n, so by Fermat s Little Theorem, y 1 1 (mod ), since does not divide n. But, y 2 + 1 0, so y 1 y 4k+2 (y 2 ) 2k+1 ( 1) 2k+1 1 (mod ), contradiction. Therefore, 1 (mod 4). Remark. The same roof can be used to show that if is a rime and (n 2 + 1), then = 2 or 1 (mod 4). Examle 4.6. Show that there are an infinite number of rimes of the form 4k + 1 and of the form 4k + 3. Solution. Suose that there are a finite number of rimes of the form 4k + 1, say 1, 2,..., n. Let N = 4( 1 2 n ) 2 + 1. By Theorem 4.7, N is only divisible by rimes of the form 4k + 1, but clearly N is not divisible by any of these rimes, contradiction. Similarly, suose that there are a finite number of rimes of the form 4k + 3, say q 1, q 2,..., q m. Let M = 4q 1 q 2 q m 1. Then M 3 (mod 4), so M must be divisible by a rime of the form 4k + 3, but M is not divisible by any of these rimes, contradiction. Examle 4.7. Show that if n is an integer greater than 1, then n does not divide 2 n 1. Solution. Let be the least rime divisor of n. Then gcd(n, 1) = 1, and by Corollary 2.2, there exist integers x and y such that nx+( 1)y = 1. If (2 n 1), then 2 2 nx+( 1)y (2 n ) x (2 1 ) y 1 (mod ) by Fermat s Little Theorem, contradiction. Therefore, (2 n 1) n (2 n 1). Theorem 4.8. Wilson s Theorem. If is a rime, then ( 1)! 1 (mod ). (See also Examle 4.5.) Proof. Consider the congruence x 2 1 (mod ). Then x 2 1 (x 1)(x + 1) 0, so the only solutions are x 1 and 1. Therefore, for each i, 2 i 2, there exists a unique inverse j i of i, 2 j 2, modulo 16

. Hence, when we grou in airs of inverses, ( 1)! 1 2 ( 2) ( 1) 1 1 1 ( 1) 1 (mod ). Examle 4.8. Let {a 1, a 2,..., a 101 } and {b 1, b 2,..., b 101 } be comlete residue systems modulo 101. Can {a 1 b 1, a 2 b 2,..., a 101 b 101 } be a comlete residue system modulo 101? Solution. The answer is no. Suose that {a 1 b 1, a 2 b 2,..., a 101 b 101 } is a comlete residue system modulo 101. Without loss of generality, assume that a 101 0 (mod 101). Then b 101 0 (mod 101), because if any other b j was congruent to 0 modulo 101, then a j b j a 101 b 101 0 (mod 101), contradiction. By Wilson s Theorem, a 1 a 2 a 100 b 1 b 2 b 100 100! 1 (mod 101), so a 1 b 1 a 2 b 2 a 100 b 100 1 (mod 101). But a 101 b 101 0 (mod 101), so a 1 b 1 a 2 b 2 a 100 b 100 100! 1 (mod 101), contradiction. Theorem 4.9. If is a rime, then the congruence x 2 + 1 0 (mod ) has a solution iff = 2 or 1 (mod 4). (Comare to Theorem 7.1) Proof. If = 2, then x = 1 is a solution. If 3 (mod 4), then by the remark to Theorem 4.7, no solutions exist. Finally, if = 4k + 1, then let x = 1 2 (2k). Then x 2 1 2 (2k) (2k) 2 1 1 2 (2k) ( 2k) ( 2) ( 1) 1 2 (2k) ( 2k) ( 2) ( 1) ( 1)! 1 (mod ). (multilying by 2k 1s) Theorem 4.10. Let be a rime such that 1 (mod 4). Then there exist ositive integers x and y such that = x 2 + y 2. Proof. By Theorem 4.9, there exists an integer a such that a 2 1 (mod ). Consider the set of integers of the form ax y, where x and y are integers, 0 x, y <. The number of ossible airs (x, y) is then ( + 1) 2 > ( ) 2 =, so by igeonhole rincile, there exist integers 0 x 1, x 2, y 1, y 2 <, such that ax 1 y 1 ax 2 y 2 (mod ). Let x = x 1 x 2 and y = y 1 y 2. At least one of x and y is non-zero, and ax y a 2 x 2 17

x 2 y 2 x 2 + y 2 0 (mod ). Thus, x 2 + y 2 is a multile of, and 0 < x 2 + y 2 < ( ) 2 + ( ) 2 = 2, so x 2 + y 2 =. Theorem 4.11. Let n be a ositive integer. Then there exist integers x and y such that n = x 2 + y 2 iff each rime factor of n of the form 4k + 3 aears an even number of times. Theorem 4.12. The Chinese Remainder Theorem (CRT). If a 1, a 2,..., a k are integers, and m 1, m 2,..., m k are airwise relatively rime integers, then the system of congruences x a 1 (mod m 1 ), x a 2 (mod m 2 ),. x a k (mod m k ) has a unique solution modulo m 1 m 2 m k. Proof. Let m = m 1 m 2 m k, and consider m/m 1. This is relatively rime to m 1, so there exists an integer t 1 such that t 1 m/m 1 1 (mod m 1 ). Accordingly, let s 1 = t 1 m/m 1. Then s 1 1 (mod m 1 ) and s 1 0 (mod m j ), j 1. Similarly, for all i, there exists an s i such that s i 1 (mod m i ) and s i 0 (mod m j ), j i. Then, x = a 1 s 1 + a 2 s 2 + + a k s k is a solution to the above system. To see uniqueness, let x be another solution. Then x x 0 (mod m i ) for all i x x 0 (mod m 1 m 2 m k ). Remark. The roof shows exlicitly how to find the solution x. Examle 4.9. For a ositive integer n, find the number of solutions of the congruence x 2 1 (mod n). Solution. Let the rime factorization of n be 2 e e 1 1 e 2 2 e k k. By CRT, x 2 1 (mod n) x 2 1 (mod e i i ) for all i, and x2 1 (mod 2 e ). We consider these cases searately. We have that x 2 1 (mod e i i ) x2 1 = (x 1)(x + 1) 0 (mod e i i ). But i cannot divide both x 1 and x + 1, so it divides one of them; that is, x ±1 (mod e i i ). Hence, there are two solutions. Now, if (x 1)(x + 1) 0 (mod 2 e ), 2 can divide both x 1 and x + 1, but 4 cannot divide both. For e = 1 and e = 2, it is easily checked that there are 1 and 2 solutions resectively. For e 3, since there is at most one factor 18

of 2 in one of x 1 and x + 1, there must be at least e 1 in the other, for their roduct to be divisible by 2 e. Hence, the only ossibilities are x 1 or x + 1 0, 2 e 1 (mod 2 e ), which lead to the four solutions x 1, 2 e 1 1, 2 e 1 + 1, and 2 e 1. Now that we know how many solutions each rime ower factor contributes, the number of solutions modulo n is simly the roduct of these, by CRT. The following table gives the answer: e Number of solutions 0, 1 2 k 2 2 k+1 3 2 k+2 Theorem 4.11. Let m be a ositive integer, let a and b be integers, and let k = gcd(a, m). Then the congruence ax b (mod m) has k solutions or no solutions according as k b or k b. Problems 1. Prove that for each ositive integer n there exist n consecutive ositive integers, none of which is an integral ower of a rime. (1989 IMO) 2. For an odd ositive integer n > 1, let S be the set of integers x, 1 x n, such that both x and x + 1 are relatively rime to n. Show that x 1 (mod n). x S 3. Find all ositive integer solutions to 3 x + 4 y = 5 z. (1991 IMO Short List) 4. Let n be a ositive integer such that n + 1 is divisible by 24. Prove that the sum of all the divisors of n is divisible by 24. (1969 Putnam Mathematical Cometition) 5. (Wolstenholme s Theorem) Prove that if 1 + 1 2 + 1 3 + + 1 1 19

is exressed as a fraction, where 5 is a rime, then 2 divides the numerator. 6. Let a be the greatest ositive root of the equation x 3 3x 2 + 1 = 0. Show that a 1788 and a 1988 are both divisible by 17. (1988 IMO Short List) 7. Let {a 1, a 2,..., a n } and {b 1, b 2,..., b n } be comlete residue systems modulo n, such that {a 1 b 1, a 2 b 2,..., a n b n } is also a comlete residue system modulo n. Show that n = 1 or 2. 8. Let m, n be ositive integers. Show that 4mn m n can never be a square. (1984 IMO Proosal) 5 Binomial Coefficients For non-negative integers n and k, k n, the binomial coefficient ( n k) is defined as n! k!(n k)!, and has several imortant roerties. By convention, ( n k) = 0 if k > n. In the following results, for olynomials f and g with integer coefficients, we say that f g (mod m) if m divides every coefficient in f g. Theorem 5.1. If is a rime, then the number of factors of in n! is n n n + + +. 2 3 It is also n s n 1, where s n is the sum of the digits of n when exressed in base. Theorem 5.2. If is a rime, then ( ) 0 (mod ) i 20

for 1 i 1. Corollary 5.3. (1 + x) 1 + x (mod ). Lemma 5.4. For all real numbers x and y, x + y x + y. Proof. x x x + y x + y Z, so x + y x + y. Theorem 5.5. If is a rime, then ( ) k 0 (mod ) i for 1 i k 1. Proof. By Lemma 5.4, k ( ) i k i + j j j=1 k k, where the LHS and RHS are the number of factors of in i!( k i)! and k i! resectively. But, = k i = 0 and k = 1, so the inequality is k k k strict, and at least one factor of divides ( ) k i. Corollary 5.6. (1 + x) k 1 + x k j=1 (mod ). Examle 5.1. Let n be a ositive integer. Show that the roduct of n consecutive ositive integers is divisible by n!. Solution. If the consecutive integers are m, m + 1,..., m + n 1, then ( ) m(m + 1) (m + n 1) m + n 1 =. n! n Examle 5.2. Let n be a ositive integer. Show that (( ) ( ) ( )) n n n (n + 1) lcm,,..., = lcm(1, 2,..., n + 1). 0 1 n (AMM E2686) Solution. Let be a rime n + 1 and let α (resectively β) be the highest ower of in the LHS (resectively RHS) of the above equality. Choose r so that r n + 1 < r+1. Then clearly β = r. We claim that ( ) m if r m < r+1, then r+1 for 0 k m. ( ) k 21 j

Indeed, the number of factors of in ( m k ) is γ = r ( ) m k m k. s=1 s Since each summand in this sum is 0 or 1, we have γ r; that is, (*) holds. For 0 k n, let ( ) ( ) ( ) n n + 1 n + 1 a k = (n + 1) = (n k + 1) = (k + 1). k k k + 1 By ( ), r+1 does not divide any of the integers ( ) ( n k, n+1 ) ( k, or n+1 k+1). Thus, r+1 can divide a k only if divides each of the integers n + 1, n k + 1, and k + 1. This imlies that divides (n + 1) (n k + 1) (k + 1) = 1, contradiction. Therefore, r+1 a k. On the other hand, for k = r 1, we have that k n and a k = (k + 1) ( n+1 k+1) is divisible by r. Therefore, β = r = α. Theorem 5.7. Lucas s Theorem. Let m and n be non-negative integers, and a rime. Let s s m = m k k + m k 1 k 1 + + m 1 + m 0, and n = n k k + n k 1 k 1 + + n 1 + n 0 be the base exansions of m and n resectively. Then ( ) ( )( ) ( )( ) m mk mk 1 m1 m0 (mod ). n n k Proof. By Corollary 5.6, n k 1 n 1 (1 + x) m (1 + x) m k k +m k 1 k 1 + +m 1 +m 0 n 0 (1 + x) k m k (1 + x) k 1 m k 1 (1 + x) m 1 (1 + x) m 0 (1 + x k ) m k (1 + x k 1 ) m k 1 (1 + x ) m 1 (1 + x) m 0 (mod ). By base exansion, the coefficient of x n on both sides is ( ) ( )( ) ( )( ) m mk mk 1 m1 m0 (mod ). n n k n k 1 22 n 1 n 0

Corollary 5.8. Let n be a ositive integer. Let A(n) denote the number of factors of 2 in n!, and let B(n) denote the number of 1s in the binary exansion of n. Then the number of odd entries in the n th row of Pascal s Triangle, or equivalently the number of odd coefficients in the exansion of (1 + x) n, is 2 B(n). Furthermore, A(n) + B(n) = n for all n. Useful Facts For a olynomial f with integer coefficients and rime, [f(x)] n f(x n ) (mod ). Problems 1. Let a and b be non-negative integers, and a rime. Show that ( ) ( ) a a (mod ). b b 2. Let a n be the last non-zero digit in the decimal reresentation of the number n!. Is the sequence a 1, a 2, a 3,... eventually eriodic? (1991 IMO Short List) 3. Find all ositive integers n such that 2 n (3 n 1). 4. Find the greatest integer k for which 1991 k divides (1991 IMO Short List) 1990 19911992 + 1992 19911990. 5. For a ositive integer n, let a(n) and b(n) denote the number of binomial coefficients in the n th row of Pascal s Triangle that are congruent to 1 and 2 modulo 3 resectively. Prove that a(n) b(n) is always a ower of 2. 6. Let n be a ositive integer. Prove that if the number of factors of 2 in n! is n 1, then n is a ower of 2. 23

7. For a ositive integer n, let C n = 1 ( ) 2n, n + 1 n and S n = C 1 + C 2 + + C n. Prove that S n 1 (mod 3) if and only if there exists a 2 in the base 3 exansion of n + 1. 6 Order of an Element We know that if a is relatively rime to m, then there exists a ositive integer n such that a n 1 (mod m). Let d be the smallest such n. Then we say that d is the order of a modulo m, denoted by ord m (a), or simly ord(a) if the modulus m is understood. Theorem 6.1. If a is relatively rime to m, then a n 1 (mod m) iff ord(a) n. Furthermore, a n 0 a n 1 iff ord(a) (n 0 n 1 ). Proof. Let d = ord(a). It is clear that d n a n 1 (mod m). On the other hand, if a n 1 (mod m), then by the division algorithm, there exist integers q and r such that n = qd + r, 0 r < d. Then a n a qd+r (a d ) q a r a r 1 (mod m). But r < d, so r = 0 d n. The second art of the theorem follows. Remark. In articular, by Euler s Theorem, ord(a) φ(m). Examle 6.1. Show that the order of 2 modulo 101 is 100. Solution. Let d = ord(2). Then d φ(101), or d 100. If d < 100, then d divides 100/2 or 100/5; that is, d is missing at least one rime factor. However, and 2 50 1024 5 14 5 196 196 14 ( 6) ( 6) 14 1 (mod 101), so d = 100. 2 20 1024 2 14 2 6 (mod 101), Examle 6.2. Prove that if is a rime, then every rime divisor of 2 1 is greater than. 24

Solution. Let q (2 1), where q is a rime. Then 2 1 (mod q), so ord(2). But ord(2) 1, so ord(2) =. And by Fermat s Little Theorem, ord(2) (q 1) q 1 q >. In fact, for > 2, q must be of the form 2k + 1. From the above, ord(2) (q 1), or (q 1) q = m + 1. Since q must be odd, m must be even. Examle 6.3. Let be a rime that is relatively rime to 10, and let n be an integer, 0 < n <. Let d be the order of 10 modulo. (a) Show that the length of the eriod of the decimal exansion of n/ is d. (b) Prove that if d is even, then the eriod of the decimal exansion of n/ can be divided into two halves, whose sum is 10 d/2 1. For examle, 1/7 = 0.142857, so d = 6, and 142 + 857 = 999 = 10 3 1. Solution. (a) Let m be the length of the eriod, and let n/ = 0.a 1 a 2... a m. Then 10 m n (10m 1) n = a 1 a 2... a m.a 1 a 2... a m = a 1 a 2... a m, an integer. Since n and are relatively rime, must divide 10 m 1, so d divides m. Conversely, divides 10 d 1, so (10 d 1)n/ is an integer, with at most d digits. If we divide this integer by 10 d 1, then we obtain a rational number, whose decimal exansion has eriod at most d. Therefore, m = d. (b) Let d = 2k, so n/ = 0.a 1 a 2... a k a k+1... a 2k. Now divides 10 d 1 = 10 2k 1 = (10 k 1)(10 k + 1). However, cannot divide 10 k 1 (since the order of 10 is 2k), so divides 10 k + 1. Hence, 10 k n (10k + 1) n = a 1 a 2... a k.a k+1... a 2k = a 1 a 2... a k + 0.a 1 a 2... a k + 0.a k+1... a 2k is an integer. This can occur iff a 1 a 2... a k +a k+1... a 2k is a number consisting only of 9s, and hence, equal to 10 k 1. Problems 25

1. Prove that for all ositive integers a > 1 and n, n φ(a n 1). 2. Prove that if is a rime, then 1 has a rime factor that is congruent to 1 modulo. 3. For any integer a, set n a = 101a 100 2 a. Show that for 0 a, b, c, d 99, n a + n b n c + n d (mod 10100) imlies {a, b} = {c, d}. (1994 Putnam Mathematical Cometition) 4. Show that if 3 d 2 n+1, then d (a 2n + 1) for all ositive integers a. 7 Quadratic Residues Let m be an integer greater than 1, and a an integer relatively rime to m. If x 2 a (mod m) has a solution, then we say that a is a quadratic residue of m. Otherwise, we say that a is a quadratic non-residue. Now, let be an odd rime. Then the Legendre symbol ( ) a is assigned the value of 1 if a is a quadratic residue of. Otherwise, it is assigned the value of 1. Theorem 7.1. Let be an odd rime, and a and b be integers relatively rime to. Then ( ) (a) a ( 1)/2 (mod ), and (b) ( a a )( b ) ( = ) ab. Proof. If the congruence x 2 a (mod ) has a solution, then a ( 1)/2 x 1 1 (mod ), by Fermat s Little Theorem. If the congruence x 2 a (mod ) has no solutions, then for each i, 1 i 1, there is a unique j i, 1 j 1, such that ij a. Therefore, all the integers from 1 to 1 can be arranged into ( 1)/2 such airs. Taking their roduct, a ( 1)/2 1 2 ( 1) ( 1)! 1 (mod ), 26

by Wilson s Theorem. Part (b) now follows from art (a). Remark. Part (a) is known as Euler s criterion. Examle 7.1. Show that if is an odd rime, then ( ) ( ) ( ) 1 2 1 + + + = 0. Solution. Note that 1 2, 2 2,..., (( 1)/2) 2 are distinct modulo, and that (( + 1)/2) 2,..., ( 1) 2 reresent the same residues, simly in reverse. Hence, there are exactly ( 1)/2 quadratic residues, leaving ( 1)/2 quadratic non-residues. Therefore, the given sum contains ( 1)/2 1s and ( 1)/2 1s. Theorem 7.2. Gauss s Lemma. Let be an odd rime and let a be relatively rime to. Consider the least non-negative residues of a, 2a,..., (( 1)/2)a modulo. If n is the number of these residues that are greater than /2, then ( ) a = ( 1) n. ( ) 1 Theorem 7.3. If is an odd rime, then = ( 1) ( 1)/2 ; that is, ( ) { 1 1 if 1 (mod 4), = 1 if 3 (mod 4). Proof. This follows from Theorem 4.9 (and Theorem 7.1). ( ) Theorem 7.4. If is an odd rime, then = ( 1) (2 1)/8 ; that is, ( ) { 2 1 if 1 or 7 (mod 8), = 1 if 3 or 5 (mod 8). 2 27

Proof. If 1 or 5 (mod 8), then ( ) 1 2 ( 1)/2! 2 4 6 ( 1) 2 ( ) ( 1 2 4 6 3 ) ( 5) ( 3) ( 1) 2 2 ( ) 1 ( 1) ( 1)/4! 2 2 ( 1)/2 ( 1) ( 1)/4 (mod ). ( ) ( By Theorem 7.1, = ( 1) ( 1)/4. Hence, 1 or 5 (mod 8). Similarly, if 3 or 7 (mod 8), then ( ) ( ) 1 3 2 ( 1)/2! 2 4 6 2 2 ( ) 1 ( 1) (+1)/4! 2 2 2 ) = 1 or 1 according as ( 1 ) ( 5) ( 3) ( 1) 2 2 ( 1)/2 ( 1) (+1)/4 (mod ). ( ) Hence, = 1 or 1 according as 7 or 3 (mod 8). 2 Examle 7.2. Prove that if n is an odd ositive integer, then every rime divisor of 2 n 1 is of the form 8k ± 1. (Comare to Examle 6.2) Solution. Let (2 n 1), where( ) is rime. Let n = 2m + 1. Then 2 n 2 2m+1 2(2 m ) 2 1 (mod ) = 1 is of the form 8k ± 1. Theorem 7.5. The Law of Quadratic Recirocity. For distinct odd rimes and q, ( ) ( ) q = ( 1) 1 2 q 1 2. q Examle 7.3. For which rimes > 3 does the congruence x 2 3 (mod ) have a solution? ( ) ( ) ( ) 3 1 3 Solution. We seek for which = = 1. By quadratic recirocity, ( ) ( ) ( ) 3 1 = ( 1) ( 1)/2 =, 3 28 2

by Theorem 7.3. Thus, in general, ( ) ( ) ( ) 3 1 3 = = ( 3 ) ( ) 2 1 = ( ). 3 And, ( 3 ) = 1 iff 1 (mod 3). Since 4 (mod 6), we have that x2 3 (mod ) has a solution iff 1 (mod 6). Examle 7.4. Show that if = 2 n + 1, n 2, is rime, then 3 ( 1)/2 + 1 is divisible by. Solution. We must have that n is even, say 2k, for otherwise 0 (mod 3). By Theorem 7.1, ( ) 3 3 ( 1)/2 (mod ). However, 1 (mod 4), and 4 k + 1 2 (mod 3) ( 3) = 1, and by quadratic recirocity, ( 3 ) ( ) = ( 1) ( 1)/2 = 1, 3 so ( ) 3 = 1 3 ( 1)/2 + 1 0 (mod ). Useful Facts (a) If is a rime and 1 or 3 (mod 8), then there exist ositive integers x and y such that = x 2 + 2y 2. (b) If is a rime and 1 (mod 6), then there exist ositive integers x and y such that = x 2 + 3y 2. Problems 1. Show that if > 3 is a rime, then the sum of the quadratic residues among the integers 1, 2,..., 1 is divisible by. 2. Let F n denote the n th Fibonacci number. Prove that if > 5 is a rime, then ( F (mod ). 5) 29

3. Show that 16 is a erfect 8 th ower modulo for any rime. 4. Let a, b, and c be ositive integers that are airwise relatively rime, and that satisfy a 2 ab + b 2 = c 2. Show that every rime factor of c is of the form 6k + 1. 5. Let be an odd rime and let ζ be a rimitive th root of unity; that is, ζ is a comlex number such that ζ = 1 and ζ k 1 for 1 k 1. Let A and B denote the set of quadratic residues and non-residues modulo, resectively. Finally, let α = k A ζ k and β = k B ζ k. For examle, for = 7, α = ζ + ζ 2 + ζ 4 and β = ζ 3 + ζ 5 + ζ 6. Show that α and β are the roots of ( ) 1 1 x 2 + x + = 0. 4 8 Primitive Roots If the order of g modulo m is φ(m), then we say that g is a rimitive root modulo m, or simly of m. Examle 8.1. Show that 2 is a rimitive root modulo 3 n for all n 1. Solution. The statement is easily verified for n = 1, so assume the result is true for some n = k; that is, 2 φ(3k) 2 2 3k 1 1 (mod 3 k ). Now, let d be the order of 2 modulo 3 k+1. Then 2 d 1 (mod 3 k+1 ) 2 d 1 (mod 3 k ), so 2 3 k 1 d. However, d φ(3 k+1 ), or d 2 3 k. We deduce that d is either 2 3 k 1 or 2 3 k. Now we require the following lemma: Lemma. 2 2 3n 1 1 + 3 n (mod 3 n+1 ), for all n 1. This is true for n = 1, so assume it is true for some n = k. Then by assumtion, 2 2 3k 1 = 1 + 3 k + 3 k+1 m for some integer m 2 2 3k = 1 + 3 k+1 + 3 k+2 M 2 2 3k 1 + 3 k+1 (mod 3 k+2 ). By induction, the lemma is roved. for some integer M (obtained by cubing) Therefore, 2 2 3k 1 1+3 k 1 (mod 3 k+1 ), so the order of 2 modulo 3 k+1 is 2 3 k, and again by induction, the result follows. 30

Corollary 8.2. If 2 n 1 (mod 3 k ), then 3 k 1 n. Proof. The given imlies 2 2n 1 (mod 3 k ) φ(3 k ) 2n, or 3 k 1 n. Theorem 8.3. If m has a rimitive root, then it has φ(φ(m)) (distinct) rimitive roots modulo m. Theorem 8.4. The ositive integer m has a rimitive root iff m is one of 2, 4, k, or 2 k, where is an odd rime. Theorem 8.5. If g is a rimitive root of m, then g n 1 (mod m) iff φ(m) n. Furthermore, g n 0 g n 1 iff φ(m) (n 0 n 1 ). Proof. This follows directly from Theorem 6.1. Theorem 8.6. If g is a rimitive root of m, then the owers 1, g, g 2,..., g φ(m) 1 reresent each integer relatively rime to m uniquely modulo m. In articular, if m > 2, then g φ(m)/2 1 modulo m. Proof. Clearly, each ower g i is relatively rime to m, and there are φ(m) integers relatively rime to m. Also, if g i g j (mod m), then g i j 1 φ(m) (i j) by Theorem 8.6, so each of the owers are distinct modulo m. Hence, each integer relatively rime to m is some ower g i modulo m. Furthermore, there is a unique i, 0 i φ(m) 1, such that g i 1 g 2i 1 2i = φ(m), or i = φ(m)/2. Proosition 8.7. Let m be a ositive integer. Then the only solutions to the congruence x 2 1 (mod m) are x ±1 (mod m) iff m has a rimitive root. Proof. This follows from Examle 4.9. Examle 8.2. For a ositive integer m, let S be the set of ositive integers less than m that are relatively rime to m, and let P be the roduct of the elements in S. Show that P ±1 (mod m), with P 1 (mod m) iff m has a rimitive root. Solution. We use a similar strategy as in the roof of Wilson s Theorem. The result is clear for m = 2, so assume that m 3. We artition S as follows: Let A be the elements of S that are solutions to the congruence x 2 1 (mod m), and let B be the remaining elements. The elements in B can be arranged into airs, by airing each with its distinct multilicative inverse. Hence, the roduct of the elements in B is 1 modulo m. The elements in A may also be arranged into airs, by airing each with 31

its distinct additive inverse, i.e. x and m x. These must be distinct, because otherwise, x = m/2, which is not relatively rime to m. Note that their roduct is x(m x) mx x 2 1 (mod m). Now if m has a rimitive root, then by Proosition 8.7, A consists of only the two elements 1 and 1, so P 1 (mod m). Otherwise, by Examle 4.9, the number of elements of A is a ower of two that is at least 4, so the number of such airs in A is even, and P 1 (mod m). Remark. For m rime, this simly becomes Wilson s Theorem. Theorem 8.8. (1) If g is a rimitive root of, a rime, then g or g + is a rimitive root of 2, according as g 1 1 (mod 2 ) or g 1 1 (mod 2 ). (2) If g is a rimitive root of k, where k 2 and is rime, then g is a rimitive root of k+1. By Theorem 8.6, given a rimitive root g of m, for each a relatively rime to m, there exists a unique integer i modulo φ(m) such that g i a (mod m). This i is called the index of a with resect to the base g, denoted by ind g (a) (i is deendent on g, so it must be secified). Indices have striking similarity to logarithms, as seen in the following roerties: (1) ind g (1) 0 (mod φ(m)), ind g (g) 1 (mod φ(m)), (2) a b (mod m) ind g (a) ind g (b) (mod φ(m)), (3) ind g (ab) ind g (a) + ind g (b) (mod φ(m)), (4) ind g (a k ) k ind g (a) (mod φ(m)). Theorem 8.9. If is a rime and a is not divisible by, then the congruence x n a (mod ) has gcd(n, 1) solutions or no solutions according as a ( 1)/ gcd(n, 1) 1 (mod ) or a ( 1)/ gcd(n, 1) 1 (mod ). Proof. Let g be a rimitive root of, and let i be the index of a with resect to g. Also, any solution x must be relatively rime to, so let u be the index of x. Then the congruence x n a becomes g nu g i (mod ) nu i (mod 1). Let k = gcd(n, 1). Since g is a rimitive root of, k i g i( 1)/k a ( 1)/k 1. The result now follows from Theorem 4.11. 32

Remark. Taking to be an odd rime and n = 2, we deduce Euler s criterion. Examle 8.3 Let n 2 be an integer and = 2 n + 1. Show that if 3 ( 1)/2 + 1 0 (mod ), then is a rime. (The converse to Examle 7.4.) Solution. From 3 ( 1)/2 3 2n 1 1 (mod ), we obtain 3 2n 1 (mod ), so the order of 3 is 2 n = 1, but the order also divides φ() 1. Therefore, φ() = 1, and is a rime. Examle 8.4. Prove that if n = 3 k 1, then 2 n 1 (mod 3 k ). (A artial converse to Corollary 8.2.) Solution. By Examle 8.1, 2 is a rimitive root of 3 k. Therefore, 2 has order φ(3 k ) = 2 3 k 1 = 2n 2 2n 1 (2 n 1)(2 n + 1) 0 (mod 3 k ). However, 2 n 1 ( 1) 3k 1 1 1 0 (mod 3), so 2 n + 1 0 (mod 3 k ). Examle 8.5. Find all ositive integers n > 1 such that is an integer. (1990 IMO) 2 n + 1 n 2 Solution. Clearly, n must be odd. Now assume that 3 k n; that is, 3 k is the highest ower of 3 dividing n. Then 3 2k n 2 (2 n + 1) 2 n 1 (mod 3 2k ) 3 2k 1 n, by Corollary 8.2 2k 1 k k 1, showing that n has at most one factor of 3. We observe that n = 3 is a solution. Suose that n has a rime factor greater than 3; let be the least such rime. Then (2 n +1) 2 n 1 (mod ). Let d be the order of 2 modulo. Since 2 2n 1, d 2n. If d is odd, then d n 2 n 1, contradiction, so d is even, say d = 2d 1. Then 2d 1 2n d 1 n. Also, d ( 1), or 2d 1 ( 1) d 1 ( 1)/2 <. But d 1 n, so d 1 = 1 or d 1 = 3. If d 1 = 1, then d = 2, and 2 2 1 (mod ), contradiction. If d 1 = 3, then d = 6, and 2 6 1 (mod ), or 63 = 7. However, the order of 2 modulo 7 is 3, which is odd, again contradiction. Therefore, no such can exist, and the only solution is n = 3. Useful Facts All rime divisors of the Fermat number 2 2n + 1, n > 1, are of the form 2 n+2 k + 1. 33

Problems 1. Let be an odd rime. Prove that for all i, 0 i 2. 1 i + 2 i + + ( 1) i 0 (mod ) 2. Show that if is an odd rime, then the congruence x 4 1 (mod ) has a solution iff 1 (mod 8). 3. Show that if a and n are ositive integers with a odd, then a 2n 1 (mod 2 n+2 ). 4. The number 142857 has the remarkable roerty that multilying it by 1, 2, 3, 4, 5, and 6 cyclically ermutes the digits. What are other numbers that have this roerty? Hint: Comute 142857 7. 9 Dirichlet Series Desite the intimidating name, Dirichlet series are easy to work with, and can rovide quick roofs to certain number-theoretic identities, such as Examle 3.2. Let α be a function taking the ositive integers to the integers. Then we say that f(s) = n=1 α(n) n s = α(1) + α(2) 2 s + α(3) 3 s + is the Dirichlet series generating function (Dsgf) of the function α, which we denote by f(s) α(n). Like general generating functions, these generating functions are used to rovide information about their corresonding number-theoretic functions, rimarily through maniulation of the generating functions. Let 1 denote the function which is 1 for all ositive integers; that is, 1(n) = 1 for all n. Let δ 1 (n) be the function defined by { 1 if n = 1, δ 1 (n) = 0 if n > 1. It is easy to check that 1 and δ 1 are multilicative. 34

Now, let α and β be functions taking the ositive integers to the integers. The convolution of α and β, denoted α β, is defined by (α β)(n) = d n α(d)β(n/d). Note that convolution is symmetric; that is, α β = β α. Theorem 9.1. Let f(s) α(n) and g(s) β(n). Then (f g)(s) (α β)(n). We now do three examles. The Dsgf of 1(n) is the well-known Riemann Zeta function ζ(s): ζ(s) = n=1 1 n s = 1 + 1 2 s + 1 3 s +, so ζ(s) 1(n). This function will lay a rominent role in this theory. What makes this theory nice to work with is that we may work with these functions at a urely formal level; no knowledge of the analytic roerties of ζ(s) or indeed of any other Dsgf is required. By Theorem 9.1, the number-theoretic function corresonding to ζ 2 (s) is 1(d)1(n/d) = 1 = τ(n). d n d n Hence, ζ 2 (s) τ(n). Finally, it is clear that 1 δ 1 (n). If α is a multilicative function, then we can comute the Dsgf corresonding to α using the following theorem. Theorem 9.2. Let α be a multilicative function. Then n=1 α(n) n s = k=0 α( k ) ks = [1 + α() s + α( 2 ) 2s + α( 3 ) 3s + ], where the roduct on the right is taken over all rime numbers. 35

As before, if we take α = 1, then we obtain ζ(s) = = = (1 + s + 2s + 3s + ) ( 1 ) 1 s 1 (1 s ), an identity that will be useful. We say that a ositive integer n > 1 is square-free if n contains no reeated rime factors; that is, 2 n for all rimes. With this in mind, we define the Möbius function µ as follows: µ(n) = 1 if n = 1, 0 if n is not square-free, and ( 1) k if n is square-free and has k rime factors. It is easy to check that µ is multilicative. By Theorem 9.2, the corresonding Dsgf is given by (1 s ) = 1 ζ(s). Hence, 1/ζ(s) µ(n), and this roerty makes the the seemingly mysterious function µ very imortant, as seen in the following theorem. Theorem 9.3. (Möbius Inversion Formula) Let α and β be functions such that β(n) = α(d). d n Then α(n) = d n µ(n/d)β(d). Proof. Let f(s) α(n) and g(s) β(n). The condition is equivalent to β = α 1, or g(s) = f(s)ζ(s), and the conclusion is equivalent to α = β µ, or f(s) = g(s)/ζ(s). Theorem 9.4. Let f(s) α(n). Then for any integer k, f(s k) n k α(n). 36

For more on Dirichlet series, and generating functions in general, see H. Wilf, Generatingfunctionology. Problems 1. Let α, β, and γ be functions taking the ositive integers to the integers. (a) Prove that α δ 1 = α. (b) Prove that (α β) γ = α (β γ). (c) Prove that if α and β are multilicative, then so is α β. 2. Prove that the following relations hold: ζ(s 1) φ(n), ζ(s) ζ(s)ζ(s 1) σ(n), ζ(s) ζ(2s) µ(n). 3. Let the rime factorization of a ositive integer n > 1 be e 1 1 e 2 2 e k k. Define the functions λ and θ by λ(n) = ( 1) e 1+e 2 + +e k and θ(n) = 2 k. Set λ(1) = θ(1) = 1. Show that λ and θ are multilicative, and that 4. For all ositive integers n, let ζ(2s) ζ(s) λ(n) and ζ 2 (s) ζ(2s) θ(n). f(n) = n m=1 (a) Show that f(n) = d n dφ(d). (b) Let n = e 1 1 e 2 2 e k k that ( 2e 1 +1 f(n) = 1 + 1 1 + 1 n gcd(m, n). > 1 be the rime factorization of n. Show ) ( 2e 2 +1 5. Verify Examle 3.2 in one calculation. 37 2 + 1 2 + 1 ) ( 2e k +1 1 + 1 k + 1 ).

6. Let id denote the identity function; that is, id(n) = n for all n. Verify each of the following identities in one calculation: (a) φ τ = σ. (b) µ 1 = δ 1. (c) µ id = φ. (d) φ σ = id τ. (e) σ id = 1 (id τ). 7. Let a 1, a 2,..., be the sequence of ositive integers satisfying a d = 2 n d n for all n. Hence, a 1 = 2, a 2 = 2 2 2 = 2, a 3 = 2 3 2 = 6, a 4 = 2 4 2 2 = 12, and so on. Show that for all n, n a n. Hint: Don t use the Dsgf of (a n ) 1 ; use the Möbius Inversion Formula. Bigger Hint: Consider the function f : [0, 1] [0, 1] defined by f(x) = {2x}, where {x} = x x is the fractional art of x. Find how the formula in the roblem relates to the function f (n) = f f f. } {{ } n 8. For all non-negative integers k, let σ k be the function defined by σ k (n) = d n d k. Thus, σ 0 = τ and σ 1 = σ. Prove that ζ(s)ζ(s k) σ k (n). 10 Miscellaneous Toics 10.1 Pell s Equations Pell s equations (or Fermat s equations, as they are rightly called) are diohantine equations of the form x 2 dy 2 = N, where d is a ositive nonsquare integer. There always exist an infinite number of solutions when N = 1, which we characterize. 38

Theorem 10.1.1. If (a, b) is the lowest ositive integer solution of x 2 dy 2 = 1, then all ositive integer solutions are of the form ( (a + b d) n + (a b d) n (a + b d) n (a b ) d) n (x n, y n ) =, 2 2. d We will not give a roof here, but we will verify that every air indicated by the formula is a solution. The air (x n, y n ) satisfy the equations Therefore, since (a, b) is a solution. x n + y n d = (a + b d) n, and x n y n d = (a b d) n. x 2 n dy 2 n = (x n + y n d)(xn y n d) = (a + b d) n (a b d) n = (a 2 db 2 ) n = 1, Remark. The sequences (x n ), (y n ) satisfy the recurrence relations x n = 2ax n 1 x n 2, y n = 2ay n 1 y n 2. For x 2 dy 2 = 1, the situation is similar. If (a, b) is the least ositive solution, then the (x n, y n ) as above for n odd are the solutions of x 2 dy 2 = 1, and the (x n, y n ) for n even are the solutions of x 2 dy 2 = 1. Examle 10.1.1 Find all solutions in airs of ositive integers (x, y) to the equation x 2 2y 2 = 1. Solution. We find that the lowest ositive integer solution is (3,2), so all ositive integer solutions are given by ( (3 + 2 2) n + (3 2 2) n (3 + 2 2) n (3 2 ) 2) n (x n, y n ) =, 2 2. 2 The first few solutions are (3,2), (17,12), and (99,70). 39

Examle 10.1.2. Prove that the equation x 2 dy 2 = 1 has no solution in integers if d 3 (mod 4). Solution. It is aarent that d must have a rime factor of the form 4k+ 3, say q. Then x 2 1 (mod q), which by Theorem 4.9 is a contradiction. Problems 1. In the sequence 1 2, 5 3, 11 8, 27 19,..., the denominator of the n th term (n > 1) is the sum of the numerator and the denominator of the (n 1) th term. The numerator of the n th term is the sum of the denominators of the n th and (n 1) th term. Find the limit of this sequence. (1979 Atlantic Region Mathematics League) 2. Let x 0 = 0, x 1 = 1, x n+1 = 4x n x n 1, and y 0 = 1, y 1 = 2, y n+1 = 4y n y n 1. Show for all n 0 that y 2 n = 3x 2 n + 1. (1988 Canadian Mathematical Olymiad) 3. The olynomials P, Q are such that deg P = n, deg Q = m, have the same leading coefficient, and P 2 (x) = (x 2 1)Q 2 (x) + 1. Show that P (x) = nq(x). (1978 Swedish Mathematical Olymiad, Final Round) 10.2 Farey Sequences The n th Farey sequence is the sequence of all reduced rationals in [0,1], with both numerator and denominator no greater than n, in increasing order. Thus, the first 5 Farey sequences are: 0/1, 1/1, 0/1, 1/2, 1/1, 0/1, 1/3, 1/2, 2/3, 1/1, 0/1, 1/4, 1/3, 1/2, 2/3, 3/4, 1/1, 0/1, 1/5, 1/4, 1/3, 2/5, 1/2, 3/5, 2/3, 3/4, 4/5, 1/1. Proerties of Farey sequences include the following: 40

(1) If a/b and c/d are consecutive fractions in the same sequence, in that order, then ad bc = 1. (2) If a/b, c/d, and e/f are consecutive fractions in the same sequence, in that order, then a + e b + f = c d. (3) If a/b and c/d are consecutive fractions in the same sequence, then among all fractions between the two, (a + c)/(b + d) (reduced) is the unique fraction with the smallest denominator. For roofs of these and other interesting roerties, see Ross Honsberger, Farey Sequences, Ingenuity in Mathematics. Problems 1. Let a 1, a 2,..., a m be the denominators of the fractions in the n th Farey sequence, in that order. Prove that 10.3 Continued Fractions 1 + 1 1 + + = 1. a 1 a 2 a 2 a 3 a m 1 a m Let a 0, a 1,..., a n be real numbers, all ositive, excet ossibly a 0. Then let a 0, a 1,..., a n denote the continued fraction a 0 + a 1 + + 1 1. a n 1 + 1 a n If each a i is an integer, then we say that the continued fraction is simle. Define sequences ( k ) and (q k ) as follows: 1 = 0, 0 = a 0, and k = a k k 1 + k 2, q 1 = 0, q 0 = 1, and q k = a k k 1 + q k 2, for k 1. Theorem 10.3.1. For all x > 0 and k 1, a 0, a 1,..., a k 1, x = x k 1 + k 2 xq k 1 + q k 2. 41

In articular, Theorem 10.3.2. For all k 0, (1) k q k 1 k 1 q k = ( 1) k 1, (2) k q k 2 k 2 q k = ( 1) k a k. a 0, a 1,..., a k = k q k. Define c k to be the k th convergence a 0, a 1,..., a k = k /q k. Theorem 10.3.3. c 0 < c 2 < c 4 < < c 5 < c 3 < c 1. For a nice connection between continued fractions, linear diohantine equations, and Pell s equations, see Andy Liu, Continued Fractions and Diohantine Equations, Volume 3, Issue 2, Mathematical Mayhem. Problems 1. Let a = 1, 2,..., 99 and b = 1, 2,..., 99, 100. Prove that (1990 Tournament of Towns) 2. Evaluate a b < 1 99!100!. 8 2207 1 2207. 1 2207 Exress your answer in the form a+b c, where a, b, c, d are integers. d (1995 Putnam) 10.4 The Postage Stam Problem Let a and b be relatively rime ositive integers greater than 1. Consider the set of integers of the form ax + by, where x and y are non-negative integers. The following are true: (1) The greatest integer that cannot be written in the given form is (a 1)(b 1) 1 = ab a b. 42

(2) There are 1 (a 1)(b 1) ositive integers that cannot be written in 2 the given form. (3) For all integers t, 0 t ab a b, t can be written in the given form iff ab a b t cannot be. (If you have not seen or attemted this enticing roblem, it is strongly suggested you have a try before reading the full solution.) Before resenting the solution, it will be instructive to look at an examle. Take a = 12 and b = 5. The first few non-negative integers, in rows of 12, with integers that cannot be written in the given form in bold, are shown: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 With this arrangement, one observation should become immediately aarent, namely that bold numbers in each column end when they reach a multile of 5. It should be clear that when reading down a column, once one hits an integer that can be written in the given form, then all successive integers can be as well, since we are adding 12 for each row we go down. It will turn out that this one observation is the key to the solution. Proof. Define a graefruit to be an integer that may be written in the given form. For each i, 0 i a 1, let m i be the least non-negative integer such that b (i + am i ). It is obvious that for k m i, i + ak is a graefruit. We claim that for 0 k m i 1, i + ak is not a graefruit. It is sufficient to show that i + a(m i 1) is not a graefruit, if m i 1. Let i + am i = bn i, n i 0. Since i + a(m i b) = b(n i a), m i must be strictly less than b; otherwise, we can find a smaller m i. Then i+a(m i b) a 1 a = 1, so n i < a, or n i a 1. Suose that ax+by = i+a(m i 1) = bn i a, for some non-negative integers x and y. Then a(x + 1) = b(n i y), so n i y is ositive. Since a and b are relatively rime, a divides n i y. However, n i a 1 n i y a 1, contradiction. Therefore, the greatest non-graefruit is of the form bn i a, n i a 1. The above argument also shows that all ositive integers of this form are also non-graefruits. Hence, the greatest non-graefruit is b(a 1) a = ab a b, roving (1). 43

Now, note that there are m i non-graefruits in column i. The above tells us the first graefruit aearing in column i is n i b. Since 0, b, 2b,..., (a 1)b aear in different columns (because a and b are relatively rime), and there are a columns, we conclude that as i varies from 0 to a 1, n i takes on 0, 1,..., a 1, each exactly once. Therefore, summing over i, 0 i a 1, roving (2). (i + am i ) = i i a i i m i = m i = i + i am i = a(a 1)b 2 = bn i = i a(a 1)(b 1) 2 (a 1)(b 1), 2 a(a 1) 2 + a i Finally, suose that ax 1 + by 1 = t, and ax 2 + by 2 = ab a b t, for some non-negative integers x 1, x 2, y 1, and y 2. Then a(x 1 + x 2 ) + b(y 1 + y 2 ) = ab a b, contradicting (1). So, if we consider the airs (t, ab a b t), 0 t (a 1)(b 1)/2 1, at most one element in each air can be written in the given form. However, we have shown that exactly (a 1)(b 1)/2 integers cannot be written in the given form, which is the number of airs. Therefore, exactly one element of each air can be written in the given form, roving (3). Remark. There is a much shorter roof using Corollary 2.4. Can you find it? For me, this tye of roblem eitomizes roblem solving in number theory, and generally mathematics, in many ways. If I merely resented the roof by itself, it would look artificial and unmotivated. However, by looking at a secific examle, and finding a attern, we were able to use that attern as a sringboard and extend it into a full roof. The algebra in the roof is really nothing more than a translation of observed atterns into formal notation. (Mathematics could be described as simly the study of attern.) Note also that we used nothing more than very elementary results, showing how owerful basic concets can be. It may have been messy, but one should never be afraid to get one s hands dirty; indeed, the deeer you go, the 44 m i

more you will understand the imortance of these concets and the subtle relationshis between them. By trying to see an idea through to the end, one can sometimes feel the roof almost working out by itself. The moral of the story is: A simle idea can go a long way. For more insights on the ostage stam roblem, see Ross Honsberger, A Putnam Paer Problem, Mathematical Gems II. Problems 1. Let a, b, and c be ositive integers, no two of which have a common divisor greater than 1. Show that 2abc ab bc ca is the largest integer that cannot be exressed in the form xab + yca + zab, where x, y, and z are non-negative integers. (1983 IMO) References A. Adler & J. Coury, The Theory of Numbers, Jones and Bartlett I. Niven & H. Zuckerman, An Introduction to the Theory of Numbers, John Wiley & Sons c First Version October 1995 c Second Version January 1996 c Third Version Aril 1999 c Fourth Version May 2000 Thanks to Ather Gattami for an imrovement to the roof of the Postage Stam Problem. This document was tyeset under L A TEX, and may be freely distributed rovided the contents are unaltered and this coyright notice is not removed. Any comments or corrections are always welcomed. It may not be sold for rofit or incororated in commercial documents without the exress ermission of the coyright holder. So there. 45