Você está na página 1de 222
THE THEORY OF NUMBERS AN) INTRODUCTION P ANTHONY A. GIOJA THE THEORY OF NUMBERS An Introduction Anthony A. Gioia DOVER PUBLICATIONS, INC. Mineola, New Yor Copyright Copyright © 1970, 2001 by Anthony A. Gioia All rights reserved under Pan American and International Copyright Conventions. Published in Canada by General Publishing Company, Ltd., 30 Lesmill Road, Don Mills, Toronto, Ontario. Bibliographical Note This Dover edition, first published in 2001, is an unabridged reprint of The Theory of Numbers: An Introduction, originally published by Markham Publishing Co., Chicago, in 1970. The author has made a num- ber of corrections for this new edition, as well as adding Solutions for Selected Exercises to the backmatter. Library of Congress Cataloging-in-Publication Data Gioia, Anthony A., 1934— The theory of numbers : an introduction / Anthony A. Gioia. p. cm. — (Markham mathematics series) Originally published: Chicago : Markham Pub. Co., 1970. Includes bibliographical references and index. ISBN 0-486-41449-3 (pbk.) 1. Number theory. I. Title. IT. Series, QA241 .G56 2001 512'.7—de21 00-059603 Manufactured in the United States of America Dover Publications, Inc., 31 East 2nd Street, Mineola, N.Y. 11501 To Pat, Kathy, Mickey PREFACE THIS TEXT was developed for a first course in number theory at Western Michigan University, where students may take this course as early as their junior undergraduate year or as late as their first graduate year. With the diversity in the levels of the students’ previous training in mind, I selected the topics and methods of presentation for this text. Every chapter is written under the assumption that the student’s background consists only of calculus (including the brief introductions to analytic geometry and linear algebra). The instructor can achieve various depths in the course, in order to compen- sate for the differing backgrounds, by requiring individual students to com- plete exercises of a degree of difficulty proportionate to the student’s pro- ficiency. Because of the assumption of only a post-calculus standard of maturity of the student, any of the chapters may be presented in any trimester regardless of variations in preparedness of the audience from one trimester to another. (To aid the instructor in the selection of chapters to be presented, a table of logical dependence of the sections is given at the end of this Preface.) More- over, regardless of the extent of the student’s prior training, his sophistication increases only slightly in one trimester ; accordingly, the rate of presentation of material in this text remains almost constant throughout. Arithmetic functions are introduced early (Chapter 2) and are used often in the development (Chapter 4; Chapter 8; Section 14 of Chapter 3; and Section 30 of Chapter 5). The emphasis is on the algebraic structure of the set of functions under Dirichlet convolution; although this has been common in the literature, it has received inadequate stress in published texts. The algebraic viewpoint has the obvious advantage of leading to the development of a calculus which eliminates the exigency of proofs replete with mysterious combinatorial and unpleasant computational techniques. In Chapter 8 the Erdés-Selberg proof of the Prime Number Theorem is given. In part, my reason for choosing to give the elementary proof rather than a nonelementary proof of the Prime Number Theorem is that the elementary proof comes as an easy (though not short) application of methods already used in Chapter 4 to derive the standard results on orders of magni- tude, namely, the Euler-McLaurin sum formula, summation by parts, and vii viil PREFACE changing the order of summations. And in part my reason is that the under- graduate rarely has the requisite background in function theory to follow a nonelementary proof. In addition to the introductions to the theory of arithmetic functions and analytic number theory cited above, the text also gives introductions to algebraic and geometric number theory. The former is furnished by the study of the Gaussian integers (to enumerate the ways of representing a positive integer as a sum of two squares), and the Jacobian integers (to prove the insolvability of the Fermat cubic). Because of the emphasis on the similarity of methods used for the rational, Gaussian, and Jacobian integers, the student can appreciate that these are but three special cases of a general theory. The introduction to geometric number theory is supplied by the use of geo- metric methods in the proof of the Quadratic Reciprocity Law (the concept of a lattice point is introduced in Section 17); in the proofs of certain asymp- totic formulas for summatory functions (in Sections 19, 21, and 22); and, of course, throughout Chapter 9. I wish to thank Professor John Petro and Dr. A. M. Vaidya for reading the manuscript, pointing out an embarrassing number of errors, and helping to supplement the original lists of exercises; Professor William J. LeVeque for his valuable suggestions about the final chapters; and Mrs. Judith Warriner for typing the manuscript. AAG, September, 1969 Kalamazoo, Michigan PREFACE ix LOGICAL DEPENDENCE OF SECTIONS Chapter 2 Chapter 3 Chapter 4 1, 2, 3,4 1,2,3,4 10 Chapter 6 11 4 10, 12 Chapter 7 Chapter 8 Chapter 9 19 20, 23 4 35 coepe 117 B) Bf) fy] CA} [io] C7) Bs] ca [ o ‘Need the statement of Theorem 27.1. *Need Section 11 for Exercises. “Need Section 17 for Exercises. ‘Need Lemma 26.2, which can be proved after Section 10, *Need Section 17 for an example. Preface CONTENTS CHAPTER 1 FUNDAMENTAL CONCEPTS 1. 2. 3. 4. Divisibility The ged and the lcm The Euclidean Algorithm The Fundamental Theorem CHAPTER 2 ARITHMETIC FUNCTIONS 1 CHAPTER 3 SwHernannm The Semigroup of Arithmetic Functions The Group of Units in of The Subgroup of Multiplicative Functions The Mobius Function and Inversion Formulas The Sigma Functions The Euler g-Function CONGRUENCES AND RESIDUES Complete Residue Systems Linear Congruences Reduced Residue Systems Ramanujan’s Trigonometric Sum Wilson’s Theorem Primitive Roots Quadratic Residues Congruences with Composite Moduli CHAPTER 4 SUMMATORY FUNCTIONS Introduction The Euler-McLaurin Sum Formula Order of Magnitude of z(n) Order of Magnitude of a(n) Sums Involving the Mobius Function Squarefree Integers xi vii Oona he xii CONTENTS CHAPTER 5 SUMS OF SQUARES 25. Sums of Four Squares 84 26. Sums of Two Squares 87 27. Number of Representations 90 28. The Gaussian Integers 90 29. Proof of Theorem 27.1 95 30. Restatement of Theorem 27.1 96 CHAPTER 6 CONTINUED FRACTIONS, FAREY SEQUENCES, THE PELL EQUATION 31. Finite Continued Fractions 98 32. Infinite Simple Continued Fractions 103 33. Farey Sequences 107 34. The Pell Equation 110 35. Rational Approximations of Reals 114 CHAPTER 7 THE EQUATION x*+)"=7,n<4 36. Pythagorean Triples 120 37, The Equation x* + y* = z+ 122 38. Arithmetic in #(./ —3) 123 39. The Equation x? + y? = z? 126 CHAPTER 8 THE PRIME NUMBER THEOREM 40. Introductory Remarks 129 41. Preliminary Results 130 42, The Function (x) 134 43. A Fundamental Inequality 140 44. The Behavior of r(x)/x 144 45. The Prime Number Theorem and Related Results 153 CHAPTER 9 GEOMETRY OF NUMBERS 46. Preliminaries 160 47. Convex Symmetric Distance Functions 164 48. The Theorems of Minkowski 170 49. Applications to Farey Sequences and Continued Fractions 174 Solutions for Selected Exercises 181 Bibliography 203 Index 205 Chapter 1 FUNDAMENTAL CONCEPTS 1. Divisibility Let # denote the set of integers, that is, # ={...,-3,-2,—1,0,1,2,3,...}, and &* denote the set of positive integers, + = {1,2,3,... }. The following definition of divisibility introduces a relation on & which is basic to most of the material presented later. Definition. Suppose a, be &. We say a divides b (or b is a multiple of a), and write alb, if and only if there existsc € & such that ac = b. If adoes not divide b, we write a/b. Notice that if b 4 0, then alb implies that a 4 0; equivalently, ifa = 0 and alb, then b = 0. However, if b = 0, then alb fot every ae &. Some further consequences of the definition are given in the theorems below. Theorem 1.1. (a) For every ae &, ala. (b) If alb and bla, thena = +b. (c) If alb and bjc, then alc. (d) If alb and alc, then al(bx + cy) for all x, ye F. Proof. The proofs of (a), (b), and (c) are left as exercises. To prove (d) we observe that alb and alc implies the existence of d, e ¢ & such that ad = band ae = c. But then a(dx + ey) = bx + cy forall x, ye #, and sincedx + eye &, we have al(bx + cy), as required. Theorem 1.2. If b 4 0 and ab, then |a| < |B]. Proof. For some ce &, we have ac = b. Then |[a||c| = |b| 4 0. Thus, |c| # 0, so |c| > 1. Therefore, |al < |al|c| = |d]. 1 2 THE THEORY OF NUMBERS: AN INTRODUCTION Theorem 1.3. If ac ¥ and be &*, then there exist unique q,r¢ & such that a=bat+r0sr0, thna+b2>0 and a+beY; if a<0, then a+ b(-a) = a(l — b) > 0 and is an element of &% In either case Y contains non-negative integers, and therefore contains a smallest non-negative integer, say r. Suppose that r occurs in Y with x = —q, so we have O b, then a — bq = b, from which it follows that O r and there are integers q and r as stated in the theorem. To prove uniqueness, we assume there are integers g, q,, r, r,, such that a=bq+r, O 0, the corollary is the same as Theorem 1.3. If b < 0, then aand |b| satisfy the hypothesis of Theorem 1.3, so there exist q',re#% such that a = |blq’ + r,0 = 6, (6,8) = 24. It is easy to see that always exists for any pair of non-zero integers a and b, and in fact the Icm is the least positive member of the set SF ={n:neF*, dn, bln}. The essential part of the argument should be familiar by now, Since |ab| e Y there is a least positive member me & Clearly m has properties (a) and (b). Suppose ne % and a\n, bln. We find g, re & such thatn = mgt+r,0 = |abJ. Proof. Suppose (a,b) = d and = | ; (b) = [al if and only if bla. Prove (a) if (a,b) = (a,c) and ¢a,b> = ¢a,c>, then b = +c; (b) = (); (c) (a, ) = (ab), (a.c)>. Suppose not both of a, b are zero. Let BG, ={d:dja} and Q, = {d: db}. Show that Z, 7 QB, is a non-empty finite set. Prove that (a,b) is the largest element in 9, 7 Bp. Suppose f(x) is a polynomial of degree >1 with coefficients in &. If the equation f(x) = 0 has a rational root a/b, b # 0, (a,b) = 1, prove that a divides the constant term of f(x) and b divides the leading coefficient of f(x). Prove this partial converse of Theorem 2.2: If 0 < d, dla, d|b, and (afd, b/d) = 1, then (a,b) = d. Suppose ab # 0. Let &, = {e:de} and & = {e: de}. Prove that is the smallest positive element in & 7 &. The gcd of more than two integers is defined as follows: If a,,...,4, (2 > 2) are not all zero, then their ged (a,,..., a,) = d is the unique positive integer such that dja; (i = 1,...,), and if ea; i = 1,...,n), then eld. Prove by induction that for n> 2, (a,...,4,) = (a, perry Ag ws a,). FUNDAMENTAL CONCEPTS 7 2-9.* The lem of more than two integers all different from zero is the unique positive integer m = such that ajm(i = 1,...,n), and if a{M (i = 1,...,n), then m|M. Prove that for n > 2, = (C15 666 An~ 1s Un 2-10. If (a,b) = 1, we know there are integers u and v such that au + bv = 1, Prove (u,v) = (b,u) = (a,v) = 1. 2-11.* Ifb 4 Oand a = bg + 17r,0 . 2-17. Prove that for every ne%, (3,n? + 1)=1, (5,n? + 2)=1, and (7,n? +2) =1. 2-18. Suppose {a,,a,...} is an infinite sequence of integers satisfying Qnt2 = ny + 4, (n = 1). If (a,,a2) = 1, prove (a,,4,4) = 1 for all ne &*, If (a;,a,) = d, prove d|(a,,a,. 1) for all ne &*. 2-19. If a,b,ne#* and n> 1, find the gcd and the lcm of n* — 1 and nv? — 1. 3. The Euclidean Algorithm We have proved the existence and uniqueness of the ged of two integers not both zero. Moreover, implicit in Exercise 2-4 is a method for finding the ged, though that method is inefficient and cumbersome for very large a,b. We now consider a more efficient method for finding the gcd of two integers. Let us begin with an example. To find (245,1022) we repeatedly use the division algorithm to find (1) 1022 = 245(4) + 42, 0 < 42 < 245 (2) 245 = 42(5) + 35, 0 < 35 < 42 (3) 42 = 35(1) + 7, 0<7<35 (4) 35 = 7(5) + 0, 0<0<7. 8 THE THEORY OF NUMBERS; AN INTRODUCTION Now we can say that 7 = (245,1022), because from (4), 7/35; therefore 7|7 and 7|35, so 7 divides any linear combination of 7 and 35. In particular, 42 is such a combination, from (3), so 7/42. Now 7/35 and 742, so 7/245 since (2) shows 245 is a linear combination of 35 and 42. Finally, we see from (1) that 7/1022 since 7|42 and 7/245. Hence, 7 is a common divisor of 245 and of 1022. To show that 7 is the greatest of the common divisors, suppose e245 and e|1022. First we rewrite (1), (2), and (3) in the form (5) 42 = 1022 + 245(—4) (6) 35 = 245 + 42(-5) (7) 7 = 42 + 35(-1). From (5) we see that e|42; then from (6) we see that e/35. Consequently, (7) tells us that e|7, so that 7 is the gcd. This entire argument may be given more elegantly by using Exercise 2-11 and Exercise 2-1(c) to observe that (1022,245) = (245,42) = (42,35) = (35,7) = 7. This process for finding the ged is known as the Euclidean algorithm. Wecan also use this algorithm to find integers x and y such that 7 = 1022x + 245y, as follows. Substitute from (6) into (7) to get T= 424 35(-1) = 42 + (245 + 42(—5))(—1) = 245(—1) + 42(6); now substitute from (5) to get 7 = 245(— 1) + (1022 + 245(—4))(6) = 1022(6) + 245(—25). The above algorithm may be applied to any pair of integers a,b not both zero. Since (a,0) = |a| for every a 40, and since (a,b) = ((al,|b|), we may assume that both a and b are positive. Then we use the division algorithm repeatedly to find q,,r;(i = 1,...,& + 1) such that a=bq,+ 1, 01, >-++: 20 is a decreasing sequence of non-negative integers and ,+1 must be zero for some k. Also, as in the example, the sequence of equations can be used to find x,y such that r, = ax + by. The lem of two integers can be found by using Theorem 2.4. In the exercises below the student will show that the gcd of more than two integers can be found by using Exercise 2-8 and the Euclidean algorithm; the lem can be found by using Exercise 2-9 and Theorem 2.4. EXERCISES 3-1. Find (20,35), (112,96), (27,45). 3-2. Use the Euclidean algorithm to find integers x,y such that (20,35) = 20x + 35y; (112,96) = 112x + 96y; (27,45) = 27x + 45y. 3-3. Find <20,35), (112,96), ¢27,45). 3-4. Use Exercise 2-8 and the Euclidean algorithm to find (a) (60,30,42,8), (b) (42,60,8,30), (c) (2250,30,540,900). 3-5. Use Exercise 2-9 and Theorem 2.4 to find (a) <60,30,42,8>, (b) <42,60,8,30>, (c) <2250,30,540,900>. 3-6. Suppose kis a non-zero integer and mand nare distinct positive integers. Prove that Qk?" +1 and (2k)?" +1 are relatively prime. 4. The Fundamental Theorem Definition. A positive integer p is called a prime if and only if p has exactly two (distinct) positive divisors. An integer n > 1 which is not prime is called composite. We note that if n<¢ ¥ and p is prime, then (»,p) is either 1 or p, and the latter occurs if and only if pln. Theorem 4.1. Suppose p is prime and a,,...,a,¢2%. If pla, ---a,, then pla; for somei, 1 1, then ncan be represented as a product of a finite number of primes, and this repre- sentation is unique except for the order of the prime factors. Proof. (Existence.) For n = 2, we obviously have n expressed as a product of primes. Suppose for all n, 2 1 into primes, we obtain a representation (8) a= [| pF i=1 where the p; are distinct primes and the «,¢ 2*. Often it is convenient to allow a; > 0. The factorization (8) is called the canonical form of n. For example, 15 = 31-5! and 25 = 5?, though sometimes it might be desirable to write 25 = 3°. 5?. Thus we could say that the canonical forms for 15 and 25 formally involve the same primes. FUNDAMENTAL CONCEPTS 11 EXERCISES 4-1. 4-4. 4-5. Suppose l Prove that for d > 0, din if and only if with 0 < 8; < «,fori=1,...,r. Suppose = Tet 2,20, and b= IP: B; = 0 Prove that (a) = [I or where y, = min (q;,8,), i = 1,...,7. Hence, use Theorem 2.4 to con- clude that 0, b> 0, alm, b\n, (a,b) = 1 and (m/a,n/b) = 1. Prove that a = (d,m) and b = (d,n). Suppose k > 2and a,,...,4,¢ %*. If 4a; i. } Pi, a 20 (f= 1,...,%), prove that (ay,..-54) = T] vp? i=l where 8, = min («,;,...,a,;) fori = 1,...,7r. With the same notation as in Exercise 4-4, prove that Cay,...,a,> = [] pt i=1 where 6; = max (%,;,...,0:) fori = 1,...,r. 12 4-6, 4-74 4-9, 4-10. 4-12. THE THEORY OF NUMBERS: AN INTRODUCTION Notice that (2,4,6) = 2 and that <2,4,6> = 12, so that 24 = (2,4,6) x <2,4,6> # 2-4-6. Thus, Theorem 2.4 cannot be extended without some restrictions. Find necessary and sufficient conditions so that for k > 2, (44, ..-5 4) (ay, ---, n> = [ay --- a. Suppose p,,...,p, ate primes and let m = p,---p, + 1. Prove that m has a prime divisor p such that p # p;,..., P # Py. Hence prove that there are infinitely many primes. Suppose ¥ is a set containing n + 1 integers t such that 1 <1 < 2n for every te X Prove there exist integers a,be Y a # b, such that alb. [Elementary Problem E1765,” Amer. Math. Monthly, Vol. 72 (1965), — p. 183.] Use the results of Exercise 4-2 to prove (a) = (a,b), ) = <(a,b), (ac). Let Y = {3n — 2:ne 2 *}. Definea prime in F to be any element of which has exactly two distinct divisors in “% For example, 4 and 7 are primes in % (a) Prove that the product of two elements in Y isin & (b) Given any te & prove that either t = 1, t is a prime in ¥ or t can be written as a product of primes in &% (c) Show that 10 and 25 are primes in &% (d) Notice that 4.25 = 10- 10, so that factorization into primes in Y is not unique. Find another element of Y which has at least two different factorizations into primes in % . Consider the table 4 7 10 13 16 19 7 12 17 22 27 32 10 17 24 31 38 45 13 22 31 40 49 58 in which the rule of formation is evident. Show that a positive integer k occurs in the table if and only if 2k + 1 is not a prime. Find a prime which is simultaneously of each of the forms a? + b?, a* + 2b?,...,a* + 10b’ for some abe &. Chapter 2 ARITHMETIC FUNCTIONS 5. The Semigroup . of Arithmetic Functions. Definition. An arithmetic function is a function whose domain is &* and whose range is a subset of the set of complex numbers. For example, f(n) = n for all ne ¥*, and g(n) = e where i? = —1 are atithmetic functions, Let o denote the set of all arithmetic functions. If f and g € .&% the product (or Dirichlet convolution product) of f and g is the function denoted by f.g and defined at each ne ¥* by fan) = 5 rb (4 d|n where the summation extends over all positive divisors d of n. Examples. F-a(1) = f(1) 80) f+ 8(2) = fl) (2) + F(2) (1) f+ 3(6) = £1) 96) + £2) (3) + £3) 82) + FO gD) Notice that this product is in fact a binary operation on / since f, ge a implies f-g¢.%, which follows from the fact that sums and products of complex numbers are complex numbers. It will be convenient to have the following equivalent form of the definition of f-g. Lemma 5.1. If f, g € 9%, then for everyne £*, fain) = ¥ fla)e(b) ab=n where the summation extends over all ordered pairs a, b of positive integers whose product is n. 13 14 THE THEORY OF NUMBERS: AN INTRODUCTION Proof. By Exercise 1-7, dln if and only if (n/d)|n. Therefore, as d ranges over all positive divisors of n, the ordered pairs d, n/d range over all ordered pairs of positive integers whose product is n. Theorem 5.1. The product of arithmetic functions is associative ; that is, if f, 8, he &, then (f-g)-h(n) = f-(g-h)(n) for everyne SX. Proof. For any fixed ne #*, (f-g) hn) = Y f-g(@) he) de=n z Z Say} ne) de=n La dX F@ gb) Hc) abe=n y flay, Y, ett) He)} ae=n bese = Y fa@g-hle) ae=n = f-(g- AY). Analgebraic system (4 x )consisting of a set Y together with an operation “x” on ¥ is called a semigroup provided that “ x” is associative. In this terminology we have proved that (.o4-) is a semigroup. This semigroup of arithmetic functions has other interesting properties, as we now show. Il li Theorem 5.2. The product of arithmetic functions is a commutative opera- tion; that is, if f, g € of, then f-g(n) = g-f(n) forallne X*. Proof. fs) = ¥ fa@s) ab=n De) fa) = 8-/(0). We now consider this question: Does there exist a function ¢ in .& such that f-e =e-f =f for every feof? The reader is probably aware of the fact that such an element in a semigroup is called the identity of the semigroup. Thus, our question is : Does there exist an identity ¢ in (.o%, - )? Evidently, since the product of functions is commutative, it will suffice to investigate the exist- ence of a function ¢ such that f = ¢-f for all f¢., or equivalently, such that for every fe &, (vy) f(n) =e-f(n) forall neX*. ARITHMETIC FUNCTIONS 15 We shall assume there is such an identity ¢ and find the necessary proper- lies which this function must have. Writing out (1) for n = 1, we have f(1) = (1) f(1). Since this last equation must hold for all fe. it must hold in particular if /(1) # 0, so we must have e(1) = 1. Writing out (1) for n = 2 gives F(2) = (1) FQ) + e(2) f(D. Since e(1) = 1, the above equation reduces to 0 = e(2) f(1), which will hold for arbitrary f only if e(2) = 0. Now we continue by induction. Assume that e(n) = 0 for n = 2,...,k — 1 (k => 3)and consider (1) for n = k. fie) = Sate s(5 alk k fe) = a 700 + Fae s(3) = a sO) 1 1. The converse of this statement answers the question asked earlier. The proof of the converse is left as an exercise. A convenient description of the function ¢ can be given in terms of the largest integer function (sometimes called the ‘“‘square bracket” function). If x is a real number, then [x] is defined by [x] = max {nine Zn< x}. Thus, [x] is the largest integer which does not exceed x; for example, [2] = 2, (/3] = 1,[-7/2] = —4. Now notice that a(n) = [1/n]. The results of this section are summarized in Theorem 5.3. Theorem 5.3. The system (4, -) is a commutative semigroup with identity e, where e is the arithmetic function satisfying e(n) = [1/n]. EXERCISES 5-1.* Prove that ¢ is the identity in (9%, -). 5-2, Suppose f(n) = 1 for allne &*, and suppose pisa prime. For ke Z*, find f- f(p’. 5-3. Suppose f(2) = —1 and f(n) = 0 if n 4 2, g(3) = 1 and g(n) = 0 if n # 3. Find fg. 16 THE THEORY OF NUMBERS: AN INTRODUCTION 5-4. Suppose f(n) = 1 for every ne #*, g(1) = 1, g(p) = —1, and g(p*) = 0 for k > 1, where p isa fixed prime. Find f- f - g(p") for all k = 0. 5-5.* Define O(n) = 0 for every ne &*. Show that 0- f = 6 for every fe a, and if g-f = g for every fe, then g = 0. 5-6. Anelement fin a semigroup is called an idempotent if it has the property that f- f = f. Show that ¢ and 0 are the only idempotents in 6. The Group of Units in Definition. Suppose f ¢ of If there is a function f' € of such that f-f' = e, then f' is called the inverse of f. Evidently not every arithmetic function has an inverse. For example, there can be no function 6’ (see Exercise 5-5 for the definition of @) such that 0-8(n) = e(n) for every n, because at n = 1 this would require that 0 = O(1) O'(1) = 0-01) = (1) = 1, which is impossible. The example shows essentially the only way that a function can fail to have an inverse. The situation is described in the next theorem. Theorem 6.1. A necessary and sufficient condition that the inverse of f exist is that f (1) # 0. Proof. Suppose f’ exists. Since f- f’(1) = e(1), we have f(1) # 0. Conversely, suppose f(1) # 0 and consider the function g defined induc- tively by a(l) = ra 7D fc) n>, Oden We will show that f-g = ¢, which will prove that g = f’ (see Exercise 6-1). Obviously f-g(1) = 1 = 1) and F-(2) = f(g + f(2)a(1) = FO TE Fa)«00} + f(2) g() ARITHMETIC FUNCTIONS 17 Suppose f- g(k) = 0 for k = 2,...,n — 1(n > 3). Then f-g(n) = f(n)g(l) + 2» f(a) g(b) ab=n 1 al ZF aah = f(n)a(1) » f@) XY fst) — fg) Ae en cd=b = f(g x. f(a) » f(c)g@)+ ¥ flag) 7H. d=b ben = f(nya(l) - a yy a) f -g(b) + J fos By the inductive assumption, the only non-zero term in the first summation occurs for b = n, so the above ‘implies to San) = f(g) — aor a(n) + 2 foe This completes the induction and shows that for all n, f-g(n) = e(n). Definition. The set Y < of is defined by U={ fest: f(l) # 0}. The last theorem shows that % is just the set of functions which have inverses. This set % is called the set of units in . It is known that the set of units in a semigroup is a group called the “group of units”; though this result holds in more general situations, we state it only for &% The proof is left as an exercise. Theorem 6.2. The set & of units in of is a commutative group. That is, (a) iff,ge%, thenf-ge®; (b) the product of functions in & is associative and commutative ; (c) the identity ce %; (d) iffe%, then f’ exists and f’ € &. EXERCISES 6-1. Suppose f € #7 If there exists a pair of functions f’ and g ¢ a such that ff’ =eand f-g =, prove that f’ = g. 6-2. Prove Theorem 6.2. 18 THE THEORY OF NUMBERS: AN INTRODUCTION 6-3. If f(n) = 1 for all n, find f'(n) for 1 Hae" " m a Y flab)g alm bin Thus, f-g¢7@. The above theorem may be applied to obtain an interesting corollary. We first introduce a special class of multiplicative functions. Definition. Let s be any complex number. The functions 1, € & are defined by i(n) = nS, nEeF*. We will refer to these functions as the iota functions. ARITHMETIC FUNCTIONS 19 We have left as an exercise the demonstration that every iota function is multiplicative---in particular, the function tw €. [t(n) = 1 for all nj; it follows from Theorem 7.1 that if fe, then f-t9 <4. This is equivalent to the following important result. Corollary 7.1. If f is a multiplicative function and if g(n) “2S (), then g is also multiplicative. Continuing now with the demonstration that .@ is a group, we establish the following. Theorem 7.2. If fe 4, then f’ exists and f' 1 » ra sos(® |s ri 5} + rom abe Lio sor ("| r(5| — F (em) F(a) + Fn) alm bln Hero gros Gh en + som (2) 0 = e(m) e(n) — f'n) f'n) + f'(mn), Since 1 < k, at least one of m,n is larger than 1, so e(m) e(n) vanishes. From (2) we have f’(m) f'(n) = f'(mn), and by induction, f’ ¢.@. 20 THE THEORY OF NUMBERS: AN INTRODUCTION We have already shown that the product of functions is associative and commutative in .»; therefore, the product also has these properties in @. It is easy to see that the identity e¢.#% These observations, together with our last two theorems, prove Theorem 7.3. Theorem 7.3. The set of multiplicative functions is a commutative group. EXERCISES 7-1. Show that ¢ is multiplicative. 7-2.* If ne ¥* and s is a complex number, say s = o + it with o,t real, then n° = n°{cos(t log n) + isin (tlog n)}. If mne X* and s is com- plex, prove that m‘n® = (mn)*. Hence prove that for every complex S, ts € A. 7-3. Give an example of a function f such that f(1) = 1 but f is not multi- plicative. 8. The Mébius Function and Inversion Formulas The next theorem is of help in studying particular functions in .@. Theorem 8.1. Suppose f ¢ 4 and n > 1 has the canonical form (3) n= Ul pe, B, > 0. Then . f(a) = i Spf). Proof. Let f and n be as in the hypothesis. We use induction on k, For k = 1 there is nothing to prove, so assume the theorem is truefor 1 < k < K. Then Hie) Af) K = (TI rt roe) i= K-1 { TT sot} foe K I] fet. ARITHMETIC FUNCTIONS 21 This theorem tells us that a multiplicative function is completely determined by its values at p’ for every prime p and for every Be ¥*. We will show an application of Theorem 8.1 by finding the inverse of i9(n) = n° = 1 for every n. Since to € 4, we know by Theorem 7.2 that ep exists and tg € 4, so we need only find .9(p*) for primes p and for 8 = 1,2,.... Therefore, let p be any fixed prime; we proceed induction on f. For 8 = 1 we have 0 = e(p) = - tolp = svat + o(P) to(1) = 1+ (), from which we see that o(p) = —1. For f = 2, o(p2) = u) tg(p?) yields 2 = ¥ oP) lp?) = 1 — 1 + calp”), Fo So to(p?) = 0. Now assume that 1o(p*) = 0 for 2 < 6 < B; then B 0= ap) = YI oP) (1) +40) + 5 4) + 40% = (o(p”). We have shown that 1o(p) = —1 and .o(p*) = 0 if B > 2 for every prime p. Traditionally this function 1 is called the Mébius function, and is denoted by uw. Adopting this notation, we apply Throrem 8.1 to conclude that if n> 1is factored as in (3), then k = TT vt? t=1 which is 0 if any of the f; is at least 2, or (—1)* if every B; = 1. The discussion is summarized in Theorem 8.2. Theorem 8.2. The Mobius function y, defined by io: f= Mito = & is a multiplicative function with values given by 1 ifn=1; Bn) = § (—1)* ifn is the product of k distinct primes; 0 ifn is divisible by the square of some prime. 22 THE THEORY OF NUMBERS: AN INTRODUCTION Equivalently, the Mébius function satisfies the equations p(1) = 1, and for n>, YH) = 0. dln Corollary 8.2a. (Mébius inversion formula.) If () vin) = FF) then (5) fn) = ¥ aio (3) d\n Conversely, (5) implies (4). Proof, The equation (4) is simply g = f- 19, and (5) is f = g- uw. Evidently g=f-t ifand only ifg- p= feo w= f-e=f. Corollary 8.2b. Suppose gn) = YS). d|n If g is multiplicative, then so is f. Proof. This corollary is the converse of Corollary 7.1. If g = f-to, then g-u=f. Now g and pe 4%, so their product fea. The Mébius inversion formula suggests the derivation of a wide class of inversion formulas, which we make in our next theorem. The proof of the theorem is trivial. Notice that the Mébius inversion formula is a special case of the theorem. Theorem 8.3. Suppose he & and f,gex. Then f-h=g if and only if fan. EXERCISES 8-1. Prove Theorem 8.3. 8-2. An integer n is called squarefree if for every t > 1, t?,4n. (a) Prove that the integer 1 is the only positive integer which is both squarefree and a square. (b) Show that n is squarefree if and only if p(n) 4 0. (c) A function fe is called the characteristic function of a set SF if f(n) = 1 whenne¥ and f(n) = 0 whenn€ & Prove that the characteristic function of the set of positive squarefree integers is ? (u2(n) = (u(n))’). 8-3. Use the methods of this section to find c,, the inverse of t,. ARITHMETIC FUNCTIONS 23 4-4.* For any complex number s, show that the inverse ¢, of the corresponding 8-5. 8-6. 8-7, 8-8. 8-9, iota function ., is the multiplicative function such that ((p*) = — p‘ if B = 1,and = Oif B > 1, for every prime p. For which of the following sets is the characteristic function of the set a multiplicative function? (a) (1, p, p?}, prime p (b) {1, p?}, prime p (©) {2, 3, 6} (d) {1,2,3, 6} (e) {1,4, 6,24} (f) {1,3, 4, 12} Let f be the characteristic function of aset Yc ¥*, FY # YB. Show that fe. if and only if both of the following conditions hold: (a) le; (b) if(ab) = 1,aef and be Y if and only ifabe FX Define the functions F(a) = (jn) for j = 0, 1, 2. (a) Which of the functions Fy, F,, F, are in Y? (b) Which of the functions F; are in .“@? (c) Are any of the functions F; iota functions? (d) Is any one of Fo, F,, F, the characteristic function of some set Sa Ht? (ec) Find F, - u(3*) for every Be #*. If k n= |] ph, i=l define p(n) = B, +--+ + B, and v(n) = k, w(1) = p(1) = 0. Let An) = (—1) and n(n) = 2”. Prove > Ad) H(@) = n(n), and me) A = n(n) A(n). din dln (Hint: » and Ae€.4@; use Theorem 8.1.) Use the definitions given in Exercise 8-8 and prove that y (— 1° 2°) =1; ab=n hence prove that 2-7 = to. 9. The Sigma Functions Definition. Jf s is any complex number, the function o,¢ & is defined by 6, = lg. The functions o, are called sigma functions. 24 THE THEORY OF NUMBERS: AN INTRODUCTION Note. If s = 1 we will write o instead of o,; if s = 0 we will write t in place of cy. These exceptional notations for the sigma functions correspond- ing tos = 0 and s = 1 are introduced so that our notation will agree with established conventions. However, it is usually convenient to discuss the class of sigma functions without treating o and t separately. It is immediate from Theorem 7.1 that every sigma function is multi- plicative, Also a(n) = = du) ail i = eat dn from which itis clear that ,(n) denotes the sum of the s™ powers of the positive divisors of n. In particular, o(n) is the sum of the divisors of n, and t(n) is the number of divisors of n. Furthermore, if p is prime, 8 B+1 ifs=0, oP) = ¥ (pif = 4 pwr — ye” rot ifs £0. Po Now Theorem 8.1 may be used to show that if k l 1. For example, 3 = 27 — 1 and 7 = 23 — 1 are Mersenne primes. By using the identity '-1L=(x-DOt+ x1 +--+ 4D), it is easy to see that if gq = a’ — 1 is a Mersenne prime, then a = 2 and bis prime, because (a — 1)|(a® — 1), and since q is prime, a — 1 = 1. Similarly, if bis composite, then b has a divisor d, 1 < d < b, and (24 — 1)|q, contradict- ing the primality of g. Thus, a Mersenne prime is a prime of the form 2” — 1, where p is prime. A positive integer n is called perfect if a(n) = 2n. It is not known whether there are any odd perfect integers, but the following theorem gives a complete characterization of all even perfect numbers. The sufficiency was known to Euclid; the necessity was first proved by Euler. Theorem 9.1. A necessary and sufficient condition that n be an even perfect number is that n = 2?~1(2? — 1), where 2? — 1 is a Mersenne prime. Proof. Suppose n = 2?~*(2? — 1), with p and 2? — 1 prime. Then a(n) = o(2?~") o(2? — 1) = 2n. Conversely, suppose n is even and perfect. Say n = 2*m, k > 1 and m odd. We have o(n) = (2**! — 1) o(m) = 2n = 2"*'m. Then (2**! — 1)|m, say m = (2*t! — 1)M. Substituting above, we get o(m) = 2t'M. Now mand M are distinct divisors of m, so o(m) > m + M. But this gives 21M = o(m) > m+ M = 2**1M, so that m and M are the only divisors of m. Hence M = landm = 2**! - 1 is prime; as we saw earlier, 2**! — 1 is prime only if k + 1 = p is prime. Thus n is of the form described in the theorem. EXERCISES 9-1. Prove that ¢(n) is odd if and only if n is a square. 9-2. Prove that o(n) is odd if and only if n is a square or two times a square. 26 9-4, 9-5.* 9-6. 9-7. 9-8. 9-9. 9-10. 9-11. 9-12. 9-13. 9-14. THE THEORY OF NUMBERS: AN INTRODUCTION Prove that for all ne #* (a) 5 (5 =1, dln n\ aj” Suppose r and s ate complex numbers. Prove that o,:0, = t+ ,-t,- Write this identity using the summation notation involved in the definition of the product of functions. Prove that the square of the sum of the first n positive integers is equal to the sum of the cubes of the first n positive integers. If f € 4 define S* by f*(n) = (f(n))*. Prove fe implies f* ¢ for all real k. Com- bine these results to prove that (9-0 - to)? = (t+ 09)? = T3-tg = (tg + to)? + t9- If m,ne &*, then mand n are called amicable if o(m) = a(n) =m +n. (For example, 220 and 284 are amicable.) Prove that if m is even, n odd, and m and n are amicable, then m is either a square or twice a square, and n is a square. Suppose (b) Yod)nz din S(n) = [1 8@). d\n Take logarithms and apply Mdébius inversion to prove that this is equivalent to a(n) = mre (4) d|n Find all solutions of the equation t(n) = 10,ne2*. Prove that 3[o(3n + 2) and 4|o(4n + 3) for alln > 0,neF. Prove that 12|o(12n — 1) for allne 2”. If p is prime, prove o(p*)|o(p’) if and only if (a + L\(b + L. Prove that m a(n) = x cos m=1/0 2an[x + ‘) dx. m Prove that t(x) = n has infinitely many solutions x for every n > 1. Show that [l¢=n?, neX*. din ARITHMETIC FUNCTIONS 27 9-15. Prove that for n> 1, T]¢=”7 d|n if and only if n = p? or n = pq, where pg are primes. 10. The Euler y-Function Definition. The function ¢, called the Euler o-function, is defined by Prt Since ., and peM, it follows that p¢.4@ We proceed to find g(p*) for prime p. oP") = Y u@ Ae | ™ = > 4) wp’) = 11(p%) w(1) + 1@?~") Hp) -# pt ar[i— Pp Then if l0, j 1-1), P; The Euler g-function is the best known member of the class of totient functions, and is sometimes referred to as the ‘Euler totient”. To define a totient, we first need to point out that a function f € @ is called completely then e(n) = nT] j ARITHMETIC FUNCTIONS 29 multiplicative if f(mn) = f(m)f(n) for all, ne &*. Clearly, if f is completely multiplicative, then fe.#, but not conversely--for example, oe. but a(4) # o(2) o(2). Notice that in Exercise 7-2 it was shown that not only is .,¢.4, but in fact ., is completely multiplicative for every complex s. Definition. A function feo is called a totient if and only if f=¢-h, where g is completely multiplicative and h' is the inverse of a completely multiplicative function. EXERCISES 10-1. Show that ¢ is a totient. 10-2. If f is a totient, then fe7%. 10-3. Prove the identities (a) @-t= Ut, (b) Go, = ty rts (c) @ = thet. Write these identities using the summation notation. 10-4. Prove or give a counter example for the following: (a) If f is completely multiplicative, then so is f’. (b) If f and g are completely multiplicative, then so is f - g. (c) If fis a totient, then so is f’. (d) If f and g are totients, then so is f- g. 10-5. Letne #*, ke &. Prove that the set {t:k n, ne Zt. Chapter 3 CONGRUENCES AND RESIDUES 11. Complete Residue Systems If m is a fixed positive integer, the division algorithm, with m as divisor, leads to an interesting classification of all integers into disjoint classes. If a,, a, € &, we find the unique q,, r; (i = 1, 2) such that (1) a; =q,m+r,, O 1 is given, it is clear from the division algorithm that there are at most m possible values for the remainder r, and hence at most m residue classes in #/(m), On the other hand, there are at least m classes because no two of the numbers 0, 1,...,m™ — 1 are congruent (mod m), so there are always exactly m distinct residue classes. A set of mintegers which contains exactly one representative of each class is called a complete residue system modulo m, abbreviated CRS (mod m). The set {1,2,...,m} is called the least positive CRS (mod m), the set {0,1,...,m— 1} is the least non- negative CRS (mod m), and the set [Hen aol) is the absolutely least CRS (mod m). For example, if m = 6, the absolutely least CRS is the set {-—2, — 1,0, 1, 2,3}. lfm = 7, itis {—3, —2,..., 2,3}. Theorem 11.5. If {a,,...,4,,} is @ CRS (mod m), and if (km) = 1, then {ka,,..., kay} is also a CRS (mod m). Proof. Suppose that for some i # j we have ka; = ka, (mod m). Since (km) = 1, Theorem 114 implies a; = a;(mod m). But this contradicts the fact that the numbers a,,...,a,, form a CRS. Hence the set {ka,,..., ka,,} is a set of m pairwise incongruent elements, and so is a CRS (mod m), EXERCISES ~ 11-1. Prove that congruence modulo m is an equivalence relation on &. 11-2. Prove Corollary 11.3a and Corollary 11.3b. 11-3.* Ifa = b (mod m) and 0 < d|m, prove a = b (mod d). 11-4. Find x in the least non-negative CRS (mod 7) such that (a) 875 = x(mod 7), (b) 29° = x(mod 7), (c) (—4)'° = x(mod 7). 11-5. Suppose Y = (% +,-) is an algebraic system and let ¥’ denote the subset of Y obtained by deleting from the identity with respect to the operation “+”. Then # is said to be a commutative ring with identity if (Y, +) is a commutative group, (#’,-) is a commutative semigroup with identity, and “*.” is distributive over ‘+’, that is, for alla,b,ceS,a-(b+c)=a-b+a-c.F isa field if both (Y, +) and (¥’,-) are commutative groups and the distributive law holds. (a) Prove (#/(m),+,-) is a commutative ring with identity. CONGRUENCES AND RESIDUES 35 (b) Ifmis prime, prove ¥/(m) is a field. (c) Prove that if £m) is a field, then m is prime. 11-6. Show that the set {FES oo Lh contains exactly m distinct elements, no two of which are congruent modulo m. Thus prove that the absolutely least CRS (mod m) is a CRS (mod m). 11-7. Give an example to show that for some a, b, k,m we may have ka = kb (mod m), but a # b(mod m). 11-8. Give an example to show that Theorem 11.5 may not be true if (km) # 1. Prove or disprove the following statement: If {a,,...,a,,} is a CRS (mod m), and if (kym) > 1, then {ka,,...,ka,} is nota CRS (mod m). 11-9.* If b = c(mod m,) and b = c(mod m)), prove b = c (mod ). 12. Linear Congruences We will find necessary and sufficient conditions for the existence of a solution x of the congruence ax + c = 0(mod m), and show that this is related to the problem of finding solutions x,y of the linear Diophantine equation ax + by =n. (By a Diophantine equation we shall mean an equation, in one or more unknowns, whose solutions are required to be integers.) Later in this section we will show how to solve a system of linear congruences. If f(x) is a polynomial with integral coefficients, we say Xp is a solution of the congruence f(x) =0(modm) if f(x) =0(modm). The problem of finding solutions of a congruence is very different from finding solutions of polynomial equations. For example, the equation x* — 3x? + 2x = 0 has three solutions, x = 0, 1,2, but the congruence x? — 3x? + 2x = 0 (mod 3) is satisfied by every integer. As another example, x — 2 = 0 has a unique solution, but x — 2 = 0(mod 5) is solved by every x = 2 (mod 5). Finally, x? — 2 = 0 has two roots, but the congruence x? — 2 = 0(mod 3) has no solution. These examples show that a polynomial congruence may have no solutions or infinitely many solutions. That there are no other possibilities is implied by our next theorem. Theorem 12.1. Suppose f(x) is a polynomial with integral coefficients. If a = b (mod m), then f(a) = f(b) (mod m). 36 THE THEORY OF NUMBERS: AN INTRODUCTION Proof. Let (x)= ¥ cx k=0 From Corollary 11.3b, we know that a = b(mod m) implies a* = b* (mod m) for k = 1,..., 7, and from Corollary 11.3a, that c,a* = c,b* fork = 1,...,n Therefore, S cqd k= ¥ c,b* (mod m); k=0 k=O but this says f(a) = f(b) (mod m). Corollary 12.1. If a is a solution of f(x) = 0(mod m), then for every b such that b = a(mod m), b is also a solution. Because of this last result, we agree to say a congruence has n solutions if it has exactly n incongruent solutions. If m is small, solutions can be found by testing each number in a CRS (mod m), but for large m this method is impractical. For a linear congruence one may always use the Euclidean algorithm to find a solution (if one exists), and we will show that it is possible to get all solutions from a given one. Moreover, we can easily tell how many solutions will exist. The problem of finding solutions of a congruence is somewhat easier if we first prove this result on solutions of a linear Diophan- tine equation. Theorem 12.2. The equation ax + by = n has a solution x,y if and only if d = (a,b)|n. If there is a solution Xo, Yo, then there are infinitely many solu- tions: for every te &, then x,y of the form x = Xo + (b/d)t,y = Yo + (—a/dyt is a solution, and every solution x,y is of this form for some te &. Proof. Since the first part of this theorem is merely a restatement of Corollary 2.1a, we proceed with the proof of the second part. Suppose that Xo; Yo is a solution. For every te %, b a Al Xo + Gt +b Yo — at = axo + byy = 1, $0 Xo + (b/d)t, yo + (a/d)(—1) is a solution. If x,y is any solution, then we define X and Y by X = x — X9, Y= y — yo. Then n=ax + by=aAX + x9) + WY + yo) = aXy + byg + aX + bY. This gives aX + bY = 0, from which we have b a ‘ CONGRUENCES AND RESIDUES 37 Therefore, (b/d)\(a/d)X, but (a/d,b/d)=1, so (b/d)|X; say (b/d)t = X. Then (2) implies Y= —(a/d)t. Thus x =X) +X =x) +(b/dt and y = yo — (a/d)t as required. Corollary 12.2. The linear congruence ax = n(mod m) has solutions if and only if d = (a,m)|n. If there is a solution, then there are exactly d (incongruent) solutions. In particular, if (asm) = 1, then the congruence has a unique solution. Proof. The first part is evident since there exists an x such that ax =n (mod m) if and only if there exist x and y such that ax + my = n. If there is a solution x, of the congruence, then all solutions x are of the form x = x9 + (m/d)t, te & If m m x1 = %o + 7h and %2 = % +h are solutions, and if x, = x2 (mod m), then m m Xo + qh =EXt+ q iz (mod m) m t, = t, |mod ——| 3 | mma) t, = t, (mod 4d). Therefore, two solutions, x, and x, are incongruent (mod m) if and only if t, and f2 are incongruent (mod @), so there are d distinct ways to obtain incongruent solutions. Example. Consider the congruence 3x = 9(mod 12). By Theorem 11.4, this is equivalent to x = 3 (mod 4), which obviously has the solution x = 3. Then the original congruence will have (3,12) = 3 solutions, all of the form 3 + (12/3)t. Therefore, x = 3,7,11 are the solutions in the least positive CRS (mod 12) and x = —5,—1,3 are the solutions in the absolutely least CRS. The following result gives a method for finding a solution of a system of linear congruences under certain conditions. Theorem 12.3. (Chinese Remainder Theorem.) If (m,,mj) = 1 for 1 1, then d\(m,b), which contradicts that b is in a RRS (mod m). Therefore, (xp,m) = 1 and Xg is in the least positive RRS. Lemma 13.1. If {a,,...; Gem} is @ RRS (mod m) and if (km) = 1, then {ka1,..., kA g(_)} also is a RRS (mod m). The proof of the lemma is the same as the proof of Theorem 11.5. The lemma leads to this important result. Theorem 13.1. (Euler’s Theorem.) If (k,m) = 1, then ke™ = 1 (mod m). Proof. Let {a,,..+» Gym} be a RRS (mod m). Then also {ka,,..., ka gem} is a RRS (mod m), so that in some order the a; are congruent (mod m) to the ka;. Therefore, em) em) T] Ga) = J] a; (mod m); i=1 i=1 k*™ TT a; = T] a;(mod m). 40 THE THEORY OF NUMBERS: AN INTRODUCTION But (a,,m) = 1 for i= 1,..., e(m) and (IIa;,m) = 1 so we may cancel this common factor from the last congruence without affecting the modulus. A special case of Euler’s Theorem was first proved by Ferrnat. Corollary 13.1. (Fermat's Theorem.) If pis a prime, then a” = a(mod p). The Fermat (as well as the Euler) Theorem may be used to simplify computations. For example, if asked to show that 23475 = 2 (mod 7), we would notice that 23475 = 2475 = 2679)*1 = (2879.2 = 179.2 = 2(mod 7). Suppose now that for some k, k® = 1 (mod m). Then the congruence kx = 1 (mod ™m) has a solution x = k*"~+, so by Corollary 12.2, (k,m)|1, or k and m are relatively prime. This shows that the converse of the Euler Theorem is true, namely, if k”” = 1 (mod m), then (ky) = 1. Our next theorem will be applied in Section 14 in the study of another arithmetic function. Theorem 13.2. Suppose (m,n) = 1. Let 2, be a RRS (mod m) and @, be a RRS (mod n). Then the set R = {km + jn:keB,,jeB,} is a RRS (mod mn). Proof. There are v2, = en) choices for k and v2, = (m) choices for j, so at most gm) e(n) = y(mn) elements in &. That there are exactly p(mn) elements may be shown by an indirect argument. Suppose for somej,,j. € 2, and some k, ,k,€ Bz, k, < ky, we have kim + jin = kam + jan. Then (6) (i: — ja)n = (kz — ky), so n|(k, — k,). But since the k; are from a RRS (mod n), this implies k, = k2. Then (6) yields j, = j,. Thus, v2 = g(mn). We now show that no two elements of & are congruent (mod mn). Suppose instead that for k,,j;(i = 1,2) as above, we have kym + jin — (kam + jon) = qmn for some g. Then (k, — k,)m = (qm — j, + j.)n. But, as above, n|(k, — k2) implies k, = k, and it follows that j, = j2. This shows that 2 is contained in some CRS (mod mn). Finally, assume km + jneé @, and say d = (km + jn,mn). Now d divides any linear combination of these numbers, and since km? = m(km + jn) — j(mn), dkm?. Writed = ab, where alm, b|n. Since b|d, also b|km?. But (b,m) = 1, CONGRUENCES AND RESIDUES 41 so blk, and bjn, therefore b|(k,n) = 1. In a similar manner, a = 1, sod = 1. Thus, & consists of (mn) elements from a CRS (mod mn), each of which is relatively prime to mn, so & is a RRS (mod mn). EXERCISES 13-1. 13-2. 13-3.* 13-4. Give a proof of Fermat’s Theorem. In £m) consider the subset of elements %, with (i,m) = 1. Prove that this subset is a group under multiplication. [This result may be stated roughly by saying that a RRS (modm) is a group under multiplication if one recognizes that the product of two elements is equivalent to any congruent integer.] Suppose for some ke % ne ¥* we have (7) k" = 1(mod m). Prove that (km) = 1. If n is the smallest such integer for which (7) holds, prove that n|g(m). [Hint: Use the division algorithm on n and g(m).] Suppose (m,n) = 1. Let @, be a CRS (mod m) and @, be a CRS (mod n). Prove that the set € = {km + jn:ke@,,je} is a CRS (mod mn). If (am) = 1, show that the solution of ax = n (mod m) is x= qem~ tn If {a1,---, Gem} 18 @ RRS (modm) and if (k,m) > 1, prove that KH = {kay,..., kgm} is not a RRS (modm). Does there exist a non-empty subset of # which is contained in some RRS (mod m)? Suppose {a,,..., Qc} is a RRS (mod m). Use the division algorithm to find q,.r; [j= 1,...,@(m)] such that a, = mq,+7r;,0< 7; {cos “ast + isin oath => {oos nat ud + isin ast i k k CONGRUENCES AND RESIDUES 43 ke Yicos ask +i} sin amsk _ ¥ cos ansk i> sin ons . n Kk n Kk n Kk k In the last equation we have used the familiar facts that cos(—x) = cos x and sin (~ x) = —sin x for all real x. From the equation above it is clear that . 2nsk (10) > sin cmt = 0. ke®, n Applying (9) to the definition of c,(n) and using (10), the theorem is proved. Corollary 14.1. If nls, then c(n) = ¢p(n). Proof. Say nd = s. Then c(n)= cos2adk = ¥ 1 = (n). keRy keBn Before giving an evaluation of c,(n) it is helpful to prove that c, is multi- plicative. Theorem 14.2. For every s, c,€ 4. Proof. That ¢,(1) = 1 follows from the Corollary 14.1. Assume (m,n) = 1. Then e,(m)c,(n) = Y e2zisiim Y @2niskin JEeBm ke@,, = y e2nistjim + kin) jJEeAm ke®n = y e2 ist jn ken)/mn, RR, teak but by Theorem 13.2, this is just c,(mn), so c,€ 4. Taking the sum of exponentials over somewhat larger ranges than the type we have been considering, we get a geometric series. For example, 2nisinyn 1 2nis/n fe } +p nis/n x g2tiskin = é e2nisin -—1 ife #1, mt nif e775" — 1, But e?“*" = cos (2as/n) + isin (2as/n) = 1 if and only if nls. From (8) and (9), {e?nisin\n — ents — 1. Thus, we have e2niskin = \ aK, 1 n, ns. TMs 44 THE THEORY OF NUMBERS: AN INTRODUCTION Furthermore, if n is a prime power, n = p’, then Ry = {ki 1 Sk < p*} — ftp: 1 is prime if and only if (n — 1)! = —1 (mod n). Though this is nota practical test for primality for large values of n, the result is of theoretical interest and arises as a natural consequence of a theorem of Lagrange, which is proved below. Theorem 15.1. (Lagrange.) Suppose p is a prime and F(x) = Y cyt k=0 is a polynomial with integral coefficients. Then either the congruence f(x) = 0 (mod p) has at most n incongruent solutions or c, = 0 (mod p) for k = 0,1,...,n. Proof. We prove this theorem by induction on the degree of f(x). Ifn = 1 and c, # 0 (mod p), then there is just one solution of f(x) = 0 (mod p), by Corollary 12.2. Suppose Lagrange’s Theorem is true for polynomials of degree < n — 1; assume that f(x) is of degree n, and the congruence f(x) = 0 (mod p) has at least n + 1 solutions a,,..., @,,4,., which are incongruent (mod p). 46 THE THEORY OF NUMBERS: AN INTRODUCTION If c, = 0 (mod p), we construct the polynomial n~-1 ax) = 3 oyx®s K=0 clearly all n + 1 solutions of f(x) = 0 (mod p) are also solutions of g(x) = 0 (mod p), and since g(x) is of degree n — 1, we have contradicted the inductive supposition. Therefore, c, # 0 (mod p). Dividing f(x) by x — a,. 1, we find FQ) = & — ays) gx) +r where re & and q(x) is a polynomial with integral coefficients, of degree n— 1, and with leading coefficient c,. Since O = f(Gy41) = Guat — Gno1) UGn41) + 7 = r (mod p), we haver = Qand f(x) = (x — a,, :)q(x) (mod p); that is, the polynomial f(x) and the polynomial (x — a,, ,)q(x) have corresponding coefficients which are congruent (mod p). For every k #n+ 1, 0 = f(a,) = (@ — ans 1)q(a,) (mod p); since p is prime, and a, — a,, , # 0, we have by Theorem 4.1 that q(a,) = 0(mod p) fork = 1,..., n. Therefore, q(x) = 0 (mod p)is a polynomial congruence of degree n — 1 and has at least n incongruent solutions, which is a contradiction. This concludes the proof. Notice that the theorem of Lagrange is not true if the modulus is not prime. For example, the congruence x? — 5x = 0 (mod6) has four solutions, x = 0,2,3,5. Also the number of solutions may be strictly less than the degree, as in x? — 2 = 0 (mod 5), -which has only one solution, x = 3. Theorem 15.2. (Wilson.) A necessary and sufficient condition that n > 1 be prime is that (n — 1)! = —1 (mod n). Proof. Suppose n is an odd prime (if n = 2, the theorem is obvious). Consider the two polynomials fojax tod ate) = & — N& — 2)--&—(@— I) and define h(x) = f(x) — g(x). Clearly h(x) has degree n — 2. The congruence g(x) = 0 (mod n) is satisfied by each of the numbers 1, 2,...,2— 1, and by Euler’s Theorem these numbers are also solutions of f(x) = 0 (mod n). Therefore h(x) = 0 (mod n) has at least n — 1 solutions, so the coefficients are all 0 (mod »). In particular, the constant term in h(x) is 0 (mod n), or -1-(—1)""'@-— 1)! = 0(mod n), and this proves the necessity of the condition. CONGRUENCES AND RESIDUES 47 Conversely, if n is composite it has a prime divisor p, and p is a factor of (n—1)!, or (n— 1)! =0 (mod p). Evidently, then, by Exercise 11-3, (n — 1)! # —1 (mod n). EXERCISES 15-1. Prove that if n is composite, then (nm — 1)! =0 (mod n) except for n= 4. 15-2. Consider again the polynomial h(x) defined in the proof of Wilson’s Theorem. Let b, denote the coefficient of x* in h(x), for k = 1,2,..., n — 2. We proved that b, = 0 (mod n). Describe the numbers b,. 15-3. If f(x) = g(x) h(x), prove that every solution of f(x) = 0 (mod p), prime p, is either a solution of g(x) = 0 (mod p) or of h(x) = 0 (mod p). Show by an example that this need not be true if the modulus is composite. 15-4. Suppose f(x) = g"(x), ne &*. If p is a prime, prove that every solution of f(x) = 0 (mod p”) is a solution of g(x) = 0 (mod p), and vice versa. 15-5. Prove that [(n — 1)!/n] is even for n > 4. 15-6. Show that Fermat’s Theorem and Wilson’s Theorem together imply and are implied by the following statement: For all ae % and all primes p, a? + a(p — 1)! is a multiple of p. 15-7. Show that the expression a? + a(p — 1)! in Exercise 15-6 may be replaced by a + a%(p — 1)!. 16. Primitive Roots Definition. If (a,m) = 1, then a is said to belong to (the exponent) t (mod m) if and only if t is the least positive integer x such that a* = 1 (mod m). Clearly, if a belongs to t (mod m), then 1 < t < e(m). In fact, tis a divisor of y(m) (see Exercise 13-3). More generally, suppose a belongs to t (mod m). Then a = 1 (mod m) if and only if tx. Theorem 16.1. If a belongs to t, (mod m,) and a belongs to tz (mod mz), then a belongs to (mod . Now a’ = 1 (mod ) implies that a‘ = 1 (mod m,) and ¢,|t. Similarly, t2|t, so T|t. But a? = 1 (mod m,) and a” = 1 (mod m,) imply that a7 = 1 (mod 1 has primitive roots. For instance, consider m = 8. Evidently, if ais even, then a* = 1 (mod 8) has no solution by Exercise 13-3, so no even integer can be a primitive root of 8. If a is odd, then either a= +lora = +3 (mod 8); inany case, a” = | (mod 8), so every odd integer belongs to 2 (mod 8) and hence is not a primitive root, since g(8) = 4. In view of the last two examples it is natural to ask what values of m have primitive roots. We will now concern ourselves with proving that the complete answer to this question is: The integer m > 1 has a primitive root if and only if m = 2, 4, p*, or 2p", where p is an odd prime. Theorem 16.3. Suppose p is an odd prime and t\(p — 1). Then there are exactly g(t) incongruent numbers which belong to t (mod p). Proof. Let ¥(t) be the number of incongruent numbers which belong to t(mod p). We recall that if there is an a which belongs to t (mod p), then t\(p); contrapositively, if t/(p — 1), then w(t) = 0. Since there are exactly p — 1 incongruent numbers which are prime to p, and each of these belongs to some unique exponent (mod p), we have (11) p-1= ¥ wo. . l=) For each {|(p — 1), w(t) > 0. If w(t) # 0, there is some a which belongs to t(mod p). Consider the congruence x! = 1 (mod p). Evidently each of the incongruent integers a, a”,...,a' is a solution, and by Lagrange’s Theorern there can be no others. Hence every number which belongs to t is of the form a“, 1 3; ifm = 2° TT p%, p; odd primes. jet Theorem 16.4. For every (a,m) = 1, a” = 1 (mod m). Proof. If m = 2, 4, p*, or 2p® the result is immediate from Euler’s Theorem. Suppose m = 2°, B > 3. If (a,2°) = 1, then a is odd and we have already observed that a? = 1 (mod 8), or that a2) = 1 (mod 23). Suppose we have shown that for 3 < B — 1, a?*~) = 1 (mod 28~!), Then for some k, GEN = 1 KPH, Squaring both sides, we have aP42P) — 1 4 kDP + 222P-2 so that a2”) = 1 (mod 2°). Finally, suppose that m = 28 TT ph. i=1 i= If (am) = 1, then 1 = (a,24) = (apf) =--- = (ap$), and we have already shown that a2") = | (mod 24) af) = 1 (mod pf) art) = 1 (mod p?"). But A(24)|A(m), and for i = 1,...,7, Ape A(m), so a™ = 1 (mod 2°) a = | (mod pf!) a*™ = 1 (mod p**). 50. THE THEORY OF NUMBERS: AN INTRODUCTION Hence, each of the above moduli is a divisor of a“ — 1, and since the moduli are relatively prime in pairs, their product m is a divisor of a’ — 1. This completes the proof. Corollary 16.4. If m is a multiple of any number of the type (a) 4p, where p is an odd prime, or (b) pq, where p # q are odd primes, or (c) 8, then m cannot have a primitive root. Proof. Suppose m = 2° TT ph. i=l If m has a divisor of type (a), (8 = 2 and r > 1), or of type (b), (r > 2), then Am) = ¢A(2%),.. 5 Ape) < 12). Apt) S (2")--- p(pF) = gm). If 8|m (8 > 3), again A(m) < ¢(m). In any case, no a prime to mcan belong to ¢(m) (mod m). Lemma 16.5. If a is a primitive root of p*, then either a belongs to o(p*’) (mod p**') or a is a primitive root of p®*'. Every primitive root of p?*+ is a primitive root of p?. Proof. Suppose a belongs to t (mod p**+). Then t|g(p?**). From a’ = 1 (mod p**') we have the same congruence (mod p*), so (p*)|t, ie a pelos to e(p*) (mod p*). Therefore, either t = o(p") or t = pe(p*) = If a is a primitive root of p’*', and if. a belongs to t (mod P, ner 1 op’). Since a‘ = 1 (mod p*), we have at = 1 + kp’. Raising both sides of this equation to the power p, we get a’! = 1 (mod p’*'). Therefore, o(p** ')|pt, so t = ¢(p*) and ais a primitive root oe Theorem 16.5. For every B ¢ X*, there exists a primitive root of p’, where p is an odd prime. If a is a primitive root of p, then at least one of aor a+ p is a primitive root of p?. If ais a primitive root of p’ (B = 2), then a is a primitive root of p’*'. Consequently, there exists a number a (independent of B) such that a is a primitive root of p* for all Be X*. Proof. We know by Corollary 16.3 that there is a primitive root a of p. By Lemma 16.5, either ais a primitive root of p? or a belongs to ¢(p) (mod p’). In the latter case, consider a + p, which is also a primitive root of p. (a+ pyr = gop 4 (p — 1a??~1p fe = 1 — pa®?)~1 (mod p?). CONGRUENCES AND RESIDUES 51 Now if a + p belongs to ¢(p), then —pa®?)~! = 0 (mod p?), or a?" = 0 (mod p), which is impossible. Therefore, a + p belongs to (p?) (mod p?), by Lemma 16.5. Assume we have proved the existence of a primitive root for every p*, x = l,...,8 (8 = 2). If a is a primitive root of p’, then by the lemma a is also a primitive root of p’~!, so a7" = 1 + kp’~!, and pk. Raising both sides to the p™ power we get aor") = 1 + kp? (mod p’t?). Since pk, QPyr®—") ger?) # 1 (mod pet 1) so by the lemma a is a primitive root of p’*!. The induction is complete. Corollary 16.5. For every f ¢ £*, there exists a primitive root of 2p’. Proof. We know there is a primitive root a of p*. If q is even, then a + p? is an odd primitive root of p’, so we may assume a is odd. Hence a is also a primitive root of 2. By Theorem 16.1, a belongs to <¢(2),e(p")> = p(2p") (mod 2p?). In those cases where m has primitive roots, namely for m = 2, 4, p’, or 2p’, we can state exactly how many there are. Theorem 16.6. If m has a primitive root, then m has exactly @(p(m)) in- congruent primitive roots. Proof. Suppose a is a primitive root of m. Then we can easily see (Exercise 16-4) that F ={ak:k = 1,2,...,e(m} is a RRS (mod m). Consider the congruence (12) x*™ = 1 (mod m). Every a‘ € ¥ is a solution of (12). We know by Exercise 13-3 that all the solutions of (12) are in % By Theorem 16.2, the number of a“, 1 < k < ¢(m), which belong to g(m) is just the number of k, 1 < k < g(m), such that (k,p(m)) = 1. There are g(e(m)) such k. We saw in Theorem 16.5 that every primitive root of p’, 8 > 2, is also a primitive root of p’+!. This does not hold for B = 1; for example, 8 is a primitive root of 3, but not of 37. In fact, for every odd prime p, there exists a number g such that g is a primitive root of p, but not of p*. This can be seen easily from the last theorem. Let g,,...,2,, r = o(@(p)), be the incongruent (mod p) primitive roots of p. Then all the numbers g, + kp (i = 1,...,7; k=0,1,...,p — 1) are primitive roots of p and are incongruent (mod p’). But there are rp such numbers, and rp > ¢(g(p”)), so not all of them can be primitive roots of p?. This proves the following. 52 THE THEORY OF NUMBERS: AN INTRODUCTION Corollary 16.6. For every odd prime p there are o(p — 1) = p o(¢(p)) — v(o(p?)) = p e(p — 1) — g(p? — p) numbers incongruent (mod p?) which are primitive roots of p, but not of p?. EXERCISES 16-1. Find at least one primitive root for each of the following moduli: 7, 9, 13, 15, 17, 25, 27. 16-2. Suppose (a,m) = 1 and consider the sequence {b,,b,,b3,...} where b; is the least positive residue (mod m) of a‘. Prove this sequence is periodic with period equal to the exponent to which a belongs (mod m). 16-3. Suppose a belongs to t, (mod m,) and a belongs to t, (mod m,). To what exponent (mod ) does a” belong? 16-4.* If ais a primitive root of m, prove {a,a’,...,a%”} is a RRS (mod m). 16-5. Prove that if ais a primitive root of p’*+(f = 2), then sois a + kp for every k. 16-6. Iff > 2and ¥isa set ofall the incongruent primitive roots of p’, where p is an odd prime, prove that the set KH = {at kp :aeG,k =0,1,....p — 1} is a set of all the incongruent primitive roots of p**?. 16-7. Let p be an odd prime and let (a, p) = 1. Consider the sequence {ty ,t2,t3,.-.} where a belongs to t, (mod p*). Describe the sequence {t,}- 16-8. Find an integer which is a primitive root of both 29 and 73, using the information that 2 is a primitive root of 29 and 5 is a primitive root of 73. 17. Quadratic Residues We will now study polynomial congruences of the type (13) SQ) = Ay? + By + € = 0 (mod p), (A,p) = 1, Since some special techniques are required to deal with the prime 2, through- out this section p will always denote an odd prime. We first observe that it suffices to be able to solve congruences of the type (14) x? = a(mod p) in order to find all the solutions of (13). In (14), take a = B? — 4AC (mod p). If x, is a solution of (14), then there corresponds a unique y, such that 2Ay, = x, — B, since (2A,p) = 1. Now we have 0 =x? — a= (2Ay, + B)? — (B? — 4AC) = 44f(y,) (mod p). CONGRUENCES AND RESIDUES 53 But (4A,p) = 1, so we have found a solution y = y, of (13). Conversely, if there are no solutions of (14) for a = B? — 4AC, then there can be no solution of (13). Definition. Suppose (a,p) = 1. We say a is a quadratic residue of p if the congruence (14) is solvable. If (14) is not solvable, we say a is a quadratic non-residue of p. Ifx isa solution of (14), then p — x isalsoa solution and x # p — x (mod p), so by Lagrange’s Theorem these are all the solutions. Consider the numbers 17,2?,..., {(p — 1)/2}* which are obviously all quadratic residues of p. These are all distinct (mod p), because if 1 < a < b < (p — 1)/2and a? = b? (mod p), then (a — b)(a + b) = a? — b? = 0 (mod p) and either pl(a — b) or pla + b); but both are impossible. If (p — 1)/2 1 and (a,p) = 1, suppose a = ¥qf. Then (a/p) = W(q;/p)*. Obviously, this has the same value as the simplified form (a/p) = al (4:/p)- Ifa < —1, then (a/p) = (-1)""? TT @/p). By odd Example. Find (—540/7). Since — 540 = — 27335, (— 540/7) = (— 1°(2/7°(3/7)°(5/7) = — (3/7)(5/7). But 1, 2, 4 are the residues of 7, so (—540/7) = —1. More simply, since — 540 = —1 (mod 7), (—540/7) = (-1/7) = (-1)8 = -1. To be able to find (q/p) for prime q, we will use the following result. Theorem 17.3. (Gauss Lemma.) Suppose (a,p) = 1. Let u denote the number of the integers a, 2a,..., {(p — 1)/2}a whose absolutely least residues (mod p) are negative. Then (a/p) = (—1)". Proof. Let 7,,...,%, be those residues such that 0 q. In the plane, consider the three bounded regions % &, @ (see Figure 1) formed by the lines 1 Liy=5 -1 Ly:y = 4 3 q L3:y=-x ay ? Lex 2a! Lyx <5. As in the figure, let of denote the region bounded by L;, i = 2,3,5; @, the region bounded by L;,i = 1,2,3,4; and & the region bounded by L,, i = 2,3,4. Suppose j is an integer, 1 pf2 =Sr+up-Vn, or pe-1 (17) Yn= —upt+ DY ty. 8 te > p/2 Also, p | (p~Ay2 (p— 1/2 k a - Ey ka= ¥ jp l +n k=1 k=1 D =PSqp)+¥nt+ Yo te ty > p/2 Combining this last equation with (17) we get — 1)(p? - 1 stay) ~ ) =F MPD _ aye, But (p? — 1)/8 is an integer and q — 1 is even, so pP(S(q,p) — u) = 0 (mod 2) S(q.p) = u (mod 2). Then (— 1)? = (—1)" = (q/p). By a symmetric argument, (— 1)" = (p/q) and (a/p)(B/q) = (— 18?) tO = (— {Hem Hae), 58 THE THEORY OF NUMBERS: AN INTRODUCTION It is sometimes convenient to use the Law of Quadratic Reciprocity in the form (pia) = (— KP FA" Nqip). To complete our knowledge we need to know the quadratic character of 2 modulo an odd prime. This is given by Theorem 17.5. Theorem 17.5. (2/p) = (- 1)? 798 = { 1, p= +1 (mod 8) —1, p= +3 (mod 8) Proof. By the Gauss Lemma, (2/p) will be (— 1)“, where u is the number of the integers 2,2-2,3-2,...,3(p — 1)-2 which are larger than p/2. For 1 p/2 if and only if p/4 < k < (p — 1)/2. The number of such k is u = (p — 1)/2 —[p/4]. We need only know ifuis even or odd. If p = + 1(mod 8), thenu = 0(mod 2), and if p = +3(mod 8), then u = 1 (mod 2). But also, if p = +1 (mod 8), then 2 ft = 0(mod 2), and if p = +3(mod 8), then pe-i = 1 (mod 2), Example. Find (60/23). We have (60/23) = (14/23) = (2/23)(7/23) = (— 1)?9°~19(7/23) = (7/23) = (— 1823-4 23/7) = — (2/7) = —(-1)'P 78 = = 1. Or we could have computed (60/23) = (2? «3 - 5/23) = (3/23)(5/23), and then found (3/23) = (— 1)'1"1(23/3) = —(2/3) = +1, and (5/23) = (— 1)'1"2(23/5) = (3/5) = —1, so that again we find (60/23) = —1. EXERCISES 17-1. Find (— 540/11), (540/11), (311/19). 17-2. Find two solutions of x? = 58 (mod 23). 17-3. Prove Corollary 17.2. 17-4.* Suppose p is prime. Prove (— 3/p) = 1 if p = 1 (mod 6), (—3/p) = —1 if p = 5 (mod 6). 17-5. Prove: If p and g are distinct odd primes, then (p/q) = (q/p) if and only if at least one of p,q is congruent to 1 (mod 4). Consequently, (p/q) = —(q/p) if and only if p = q = 3 (mod 4). CONGRUENCES AND RESIDUES 59 17-6. Suppose f(x) = ax? + bx + c, a odd. Show that xo is a solution of (18) f(x) = 0 (mod 2) if and only if x9 is a solution of (a + b)x + c = 0(mod 2). Hence, prove that if b = 0(mod 2), (18) always has a solution, and if b = 1 (mod 2), (18) has a solution if and only if c = 0(mod 2). Also, if (18) has no roots, then a = b = c = 1 (mod 2). 17-7. Prove that (—1/p) = p(mod 4) for all odd primes p. 18. Congruences with Composite Moduli If f(x) is a polynomial with integer coefficients and p is a prime, we will show that the solutions (if any) of f(x) = 0 (mod p*) may be used to find all solutions of f(x) = 0 (mod p’*). Recall that Taylor’s Theorem says if f(x) is a polynomial of degree n, if D¥f denotes the k'* derivative of f (with the convention that D°f = f), then Also, if and if the c, are integers, then D'f (x9) " k(k — 1)---(k -—i+ 1) ent 0 —_———— = TS EE eee eee meme ned i! reat i! n {k . ~ » [et kai \l is an integer for each i, 0 < i < n, whenever Xo € &. Therefore, if x9, we Z, then flo + uy = 3 Cut where _ D*f (xo) k} Cy is an integer. 60 THE THEORY OF NUMBERS: AN INTRODUCTION Theorem 18.1. If f(x) is a polynomial with integer coefficients, if p is a prime, and if Xq is a solution of f(x) = 0(mod p"), then a necessary and sufficient condition that xq + tp’ be a solution of (19) f(x) = 0(mod p’*') is that t be a solution of (20) Df(xay = —£& ie (mod p). Proof. Suppose {x)= y cyx* and that xo + tp’ is a solution of (19). By Taylor’s Theorem, F (xo + tp’) = fo) + Df(&o)ip® + 2 C(tp’ = 0 (mod p**') k= so that Ff (Xo) + Df(xo)tp® = 0 (mod p**'), But p’| f(x9) by hypothesis, so - + Df(xo)t = 0(mod p), and the condition is necessary. Conversely, suppose f (x9) = 0 (mod p*) and t is a solution of (20). But S(xo + tp?) = f(x) + Dy (Xo)tp* (mod p?**), so f (xo + tp’) = 0(mod p**') and the condition is sufficient. Corollary 18.1. Suppose xo is a solution of f(x) = 0 (mod p*), Corresponding to Xq, there are N = N(xo) solutions xq + tp? of (19), where N = 0 if p|Df (xo) and p{ f(o)/P*}:N = pif elf (xo) and pl{ f(xo)/p} :and N = Lif pDf(xo)- The proof is left as an exercise. Example. Find all solutions of x? + x + 3 = 0(mod 5%). Clearly, x9 = 1 is the only solution of f(x) = x3 +x +3 =0(mod5); also, Df(x») = (3x? + Dle=1 = 4 f(%o)/5 = 1. With N denoting the number of solutions of 4t = —1(mod 5), we have N = 1 (t= 1). Now x9 + tp =6 is the only solu- tion of f(x) = 0(mod 5”). With x, = 6, we find Df(x,) = 109, f(x,)/5S? = 9, CONGRUENCES AND RESIDUES 61 and N is the number of solutions of 109t = —9(mod 5), or 4t = 1 (mod 5). Thus, N =1 (¢ = 4). Hence, x, + tp? = 106 is the unique solution of J (x) = 0 (mod 5°). We now consider the general problem of solving a congruence (21) f(x) = 0 (mod m) where m= [| pf. i=1 Evidently, if x9 is a solution of (21), then xq is a solution of the system ( = 0(mod pf) f(x) = 0 (mod pf"). (22) On the other hand, if x; is a solution of f(x) = 0 (mod pf), i = 1,...,7, then by the Chinese Remainder Theorem there is a solution x9 of the system x = X, (mod p4') x = x, (mod p?"); then x9, which is unique (mod m), is a solution of (22) and of (21). Therefore, all the solutions of (21) may be obtained by knowing the solutions of f(x) = 0 (mod p#* for each i, and we have seen that the solutions of these congruences may be constructed from the solutions of f(x) = 0 (mod p)). Example. Find all solutions of f(x) = x? + 4x? + 3 = 0(mod 78408). Notice that 78408 = 2334117, and Df (x) = 3x? + 8x. Let Ga(x.t) = f(x)/p? + Df (x)t. We first find solutions of f(x) = 0 (mod 23). Clearly, ay) = 1 is the only solution of f(x) = 0(mod 2), and G,(a,t) = 4 + 11t = 0 (mod 2) has the single solution t = 0. Therefore, ag + tp = a, = 1 is the only solution of f(x) = 0(mod 27). G,(a,,t) = 2 + 11t = 0(mod 2) has one solution, t = 0, SO a, + tp? = ay = 1 is the only solution of f(x) = 0 (mod 2°). Now, f(x) = 0(mod 3) has solutions by = 0 and cy = 2. G,(bo,t) = 1 + 0-t = 0(mod 3) has no solution, so there are no solutions of f(x) = 0 (mod 3+) obtainable from bg. But G,(co,t) = 9 + 28t = 0 (mod 3) has just one solution, t = 0. Therefore, cg + tp = c, = 2 is the only solution of f(x) = 0 (mod 3”). G,(c,,t) = 3 + 28 = 0 (mod 3) has t = 0 for a solution, and c, + tp? = cz = 2 is the only solution of f(x) = 0 (mod 3°). G3(c2,t) = 1 + 28t = 0(mod 3) has t = 2 for its solutions, and c, + tp? = cz = 56 is the only solution of f(x) = 0 (mod 3+). 62 THE THEORY OF NUMBERS: AN INTRODUCTION Finally, f(x) = 0 (mod 11) has solutions dy = 3, €9 = 6,29 = 9. G,(do,t) = 6 + 51t = 0(mod 11) has t = 7 for a solution, and this gives d, = 80 asa solution of f(x) =0O(mod1P). G,(@o,t) = 33 + 156 = 0(mod 11) has t = 0asasolution, and e, = 6. G,(go,t) = 96 + 315t = 0 (mod 11) has t = 2 for its solution, so g, = 31. We now need a solution of x = a, (mod 2%), x = c; (mod 3%), x = d, (mod 117). By the Chinese Remainder Theorem, x = 34117 + 27117(20)(56) + 233*(76)(80) = 5,033,801 = 15689 (mod 78408) is the solution, and hence is asolution of f(x) = 0(mod 78408). Similarly, y = 1 (mod 23), y = 56 (mod 34), y = 6(mod 117) is solved by y = 3411? + 23117(20)(56) + 2°34(76)(6) = 1,389,449 = —21895. And z = 1 (mod 8), z = 56(mod 81), z = 31 (mod 121) has the solution z = 3411? + 27117(20)(56) + 2°34(76)(31) = 2,620,649 = 33185, Therefore, the three solutions of f(x) = 0(mod 78408) are 15689, — 21895, and 33185, EXERCISES 18-1. Prove Corollary 18.1. [Hint: Use Corollary 12.2 to count the number of solutions of (20).] 18-2. Find all solutions of x* + 2x — 3 = 0(mod 125). 18-3. Find all solutions of x* + x* + x + 1 = 0(mod 273377), 18-4. Show that if n is even, then x? + x + 1 = 0 (mod n) has no solution. 18-5. Show that if 5|n, then f(x) = x® + 3 = 0(mod~z) has no solution. [Hint : Consider f(x) = 0 (mod 5) and use Fermat’s Theorem.] Chapter 4 SUMMATORY FUNCTIONS 19. Introduction The behavior of many of the arithmetic functions we have studied is quite erratic. For example, if p is prime, then t(p) = 2, and c(p) = k + 1 > 00 as n = p* — oo. Since there are infinitely many primes, there are infinitely many ne 2~ such that t(n) = 2; on the other hand, for every positive N there are infinitely many n such that t(n) > N. Thus, there is very little which can be said at this point about the behavior of t(n) as n increases without bound. The situation is somewhat more encouraging if we consider the averaging function 1 T,(n) = nit) +-++ + rn}, since averaging the values of the t function will cause the function 7, to change less drastically than does the t function. But studying the function T, is equivalent to studying the function T(n) =n T(n)= ), @). Me d 1 Functions of the type T(n) are called summatory functions, and in this chapter we study some of the summatory functions associated with the arithmetic functions we have seen previously, A few preliminaries are discussed first. Since [x] is the largest integer not exceeding x, to every real x there corresponds a real number 6, such that x = [x] + @,, 0<64,<1. If f €.& we use the notation Y fa) nsx 63 64 THE THEORY OF NUMBERS: AN INTRODUCTION to mean ix] x fn); a= if x < 1, this null summation is defined to be zero. Definition. Let g be a function of a real or integral variable such that g(x) is defined and is positive for all x sufficiently large. The sets O(g) and o(g) are defined by O(g) = { J: there exists a constant M such that IF) a(x) ), so that f + h = O(g). Property (4) may be proved as follows. Let f = o(g) and h = O(f), so that h = O(o(g)). There is a constant M such that |h(x)| < Mf(x) and f(x)/g(x) > 0. Then 0< tim MO < a tim © — 0, x70 2(x) x 0 a(x) and h = o(g). It need not be true in general that Y O(gdx)) = o| x at} i=l i= For example, for the sequence of constant functions f{u) = i, we have fi) = OL), fou) = O(1), fa(u) = O(1),..., but - G+) = Ox?) 4 Ol F | = OC). isx > fu) isx 66 THE THEORY OF NUMBERS: AN INTRODUCTION A sufficient condition is that the constants implied by the O symbols be uniformly bounded. With such a restriction we may add infinitely many error terms O(g,(x)). Suppose | f{x)| < MigAx) for i = 1,2,..., that there exists a constant M such that M; < M for all i, and that Ms g(x) i=. converges for every x = Xo. Then 6) ¥ ods = 0[ ¥ ets) i= t=1 This is because |Lf(x)| < | f{x)| < MZg{x). Obviously, (6) also holds if the series are replaced by finite sums. The above list of properties is certainly not exhaustive, but contains typical rules for combining terms involving the symbols O and o. It is usually much easier to derive whatever rules are necessary in some particular applica- tion than to memorize a lengthy list of such rules. Lemma 19.1. There is a constant y, called Euler’s constant, such that 1/2 0,80 the sequence is decreasing. SUMMATORY FUNCTIONS 67 yo I/x N N+1 Figure 2 Furthermore, for every N, yy > 0, which can be seen as follows. We have 1 = flog w - ed n=2n pS Lah mE S-3} Soa} Geometrically, this is the area of a unit square minus the sum of shaded areas of the type in Figure 2 for n = 2,...,N. These shaded areas may be translated to the left byn — 1 units; since y = 1/x is continuously decreasing, these areas ["_, x~' dx — 1/n will not overlap when translated into the unit square0 < y < 1,0 < x < Land then py is the (positive) area of the unshaded portion of the unit square, The argument is illustrated for y, in Figure 3. lI Yn ll ll ll 68 THE THEORY OF NUMBERS: AN INTRODUCTION Figure 3 Since yy > 0 for all N and the sequence {yy} is decreasing, it is convergent, say lim y, = y. From our arguments above it is clear that y is the limit of the unshaded region in the unit square under the translations described. Since this unshaded region is in the square, we evidently have y < 1. Also, it is geometrically obvious that y is the sum of a series whose N' term ay is the area of the unshaded portion of the rectangle 0 < x < 1, 1/N= y= IN + 1). Since this unshaded portion of the rectangle exceeds half the area of the rectangle (the shaded part of each rectangle lies entirely below the diagonal), we have a> {2-1 \e 1 NIN N41) 2N(N +41) Therefore, ka 12 1 1 y= Yia>3 Dd wave 2 Finally, we consider yy — y. By the translation of shaded areas we know this is the area of the unshaded portion of the unit square inside the region 0 | is arbitrary (not necessarily an integer). By what we have already proved, ” pte S. nsx = log(x] + y + oles}: “{! o(}t] x (8) log [x] = logx + log ( + o(4}} Now recall that for |t| < 1, Ban Since [x] = x + O(1), we have log [x] = log (x + O(1)) = log log +) = x cure so that wo ¢__yyr-l n toe (1 + o(3}} => (1) our) n=1 = ¥ ou 2 1 = 01d | since the constant involved in O(1/x") is 6%/n, and these are uniformly less than be mmeretons i+ o(;}) =o} =o} Thus, from (8) we have log [x] = log x + O(1/x). These results together with Exercise 19-2 into (7) “ us log yr — = logx + O(1/x) + y + O(1/x) ngxft = logx + y + O(1/x). The proof is complete. 70 THE THEORY OF NUMBERS: AN INTRODUCTION Note. Lemma 19.1 also implies (in a trivial way) certain weaker asymptotic formulas. For example, 1 Yi - = logx + O(1), nex lt because y = O(1) and O(1/x) = O(1). In many applications, we lose nothing by using a weaker result of this type. For example, see the Note after Theorem 21.1. EXERCISES 19-1. Prove properties (2), (3), and (5). 19-2. Show that O(1/(x]) = O(1/x). 19-3. Prove that ““~” is an equivalence relation on the set of positive- valued functions. 19-4. Prove the big-O relation is reflexive and transitive, but not symmetric, on the set of positive-valued functions. 19-5. Prove that the little-o relation is transitive. Show by examples that it is neither reflexive nor symmetric. 19-6.* Prove y i = O(log x). nsx 19-7. Prove the remarks made earlier, namely that the following conditions are equivalent. (a) O(f) = Og); (b) h = O(f) implies h = O(g); (c) f = O(g). 19-8. Prove the following conditions are equivalent: (a) off) = ol); (b) if h = o(f), then h = o(g); 19-9, Prove that O(O(O(g))) = O(g). 19-10. Prove o(o(g)) = o(g). 20. The Euler-McLaurin Sum Formula It is interesting to note that techniques similar to those employed in the proof of Lemma 19.1 may be applied in a more general setting to obtain a convenient tool for dealing with sums of the type under consideration in this chapter. While we will not need this result until later, we now prove Theorem 20.1. SUMMATORY FUNCTIONS 71 Theorem 20.1. (Euler-McLaurin sum formula.) Suppose f(x) is continu- ously differentiable for x > 1. Then Y soy = fa) + f “fat + i} “(= [DFU dt — (& — LX) FC. asx 1 1 Note. In many applications it is sufficient to replace the last term by O(f). Proof. We first prove the theorem when x = N is an integer. Then N yf) =N f(N)- Yh) — fin - Y} n=2 N =N f(N)- ¥ (n- nf Df (t) dt n-1 n=2 N a =N f(N-3 i} [xDF(t) at n=2¢n-1 N (9) Y f= N fo) [ taprinae nsNn 1 But, using integration by parts, N N N N i} f(j)dt=t ro] -| t Df(t)dt = N f(N) — f(l) -{ t Df(t) dt. 1 1 1 1 Substituting into (9) the expression for N f(N) from this equation, we have Ne N ¥ sny=say+ {soars fe tayppeas, nsNn 1 1 which is the result in Theorem 20.1 when x = [x] is an integer. Now suppose x is arbitrary. Then ix] ix] ¥ fn) = f(t i} fiat + i} (t — [ADF (eat nsx 1 1 = fu) +f soar + f “(= [Epp at 1 1 -| i} fide + i} «— ornart. (x) tx) But f S(jdt + f t Df(t)dt — f [t]Pf(o) at [x] ix] ix] - 0 - Bayt] = (x — [xD fo); x x ) tal i) 72 THE THEORY OF NUMBERS: AN INTRODUCTION here we have used integration by parts and observed that for [x] < t < x, [t] = [x] is constant. The proof is complete. Example. Use Theorem 20.1 to prove there is a constant C, such that 1 y an logx + C, + O(1/x). n oo, and we see that this is the case since -¢— [ft] "dt 1 o<{ 2 as[o=5 x (Pana x x t (~ (a L t? Therefore and converges, say with value 1 — C, . Substitution into (10) proves the result. EXERCISES 20-1. We have defined c=1-f ‘ty, 1 ot Y 1 y= im | y + — tog vt. N>o@ [y=] Prove that C, = y. SUMMATORY FUNCTIONS 73 20-2. Suppose N is an integer, 1 < N < x, and f(t) is continuously differ- entiable for t > 1. Prove that f(a) = FN) + i} * f(Q dt + i} “( — [Qppf(y dt + OLY), n=N N N 20-3.* Prove that 1 1 La K-; + 0U/%’) 2 nsx a for some constant K, 1 < K < 2. Itis known that K = 17/6. 20-4. Ifke#*,k > 1, prove 1 k -e —k+1 ae kal + O(x ). 20-5. Notice that 0 < t — [t] < 1 for all real t. Use this to show that x i) (t — [¢]) "1 dt = O(x4) 1 for all ke &*. Hence use the Euler~-McLaurin sum formula to prove that for every ke ¥* Y ak = Ck) x**! + O(x*) nex where C(k) is a constant depending only on k, not on x. 21. Order of Magnitude of t() Theorem 21.1. ¥. a(n) = x log x + O(x) nsx Proof. Let the plane region .of be the region bounded by the lines u = 1/2, v = 1/2, and the hyperbola uv = x (see Figure 4), where x is arbitrary but fixed. We will show that Yn) =Ag = Y [x/n). nsx nsx If1 @ is the line segment from ([/x],L,/x]) to (x/L/x]L/)), with length xf/xl - L/x] < 3; thus may be inscribed in a square with sides of length 3, and Ag cannot exceed the area of such a square, so Ag = O(1). 76 THE THEORY OF NUMBERS: AN INTRODUCTION Finally, 2Ag =2 y [xn] = 2 5 {* ~ o«1y} nsJx ns J/x Zent | Ze = 2x(log/x + » + O(1A/x) + O/x) = xlogx + 2yx + O(/x). Combining results we have ¥. e(2) = xlogx + 2px + O(/x) — x — O(/x) + O(1) nsx =2x ) 5+ of yl = x(logx + 2p — 1) + O(/x). The results in either of the last two theorems may be stated loosely by saying that c(n) has average order of magnitude equal to log n; that is, = ve (n) ~ log N. N WEN This relation follows easily from either theorem: since T(N) = ¥) a1) = NlogN + O(N), n an) nsx nsx/d Proof. YihaM= TY fash) nsx nsxab=n SUMMATORY FUNCTIONS 77 is the sum of the evaluations of f(a) g(b) at each lattice point on the upper branch of wv = n for every n, 1 e(* ¥ ua) nsx ab=n = 5 a(Sfan = g(x) since e(n) = 1 if and only ifn = 1, zero otherwise. This prove (13). Conversely, assume (13). Then Lg EE, wms( 3} - yy was ;] 3] dsxnsxfd d Stn), s real, n=1 7 is called a Dirichlet series. The convergence or divergence of these series is determined by the function f and the value of s. It is easy to prove if f(a) = O(1) and s > 1, then ims LS (n)n™* is absolutely convergent. If F(s) = x f(n)n-* and G(s) -> g(n)n- are two Dirichlet series, then the product F(s) G(s) is defined by (14) F(s) Gs) = YX f(x) gm) nm if this series is convergent. Theorem 23.2. If F(s) = Lf(n)n-* and G(s) = Lg(n)n-* are two Dirichlet series which are absolutely convergent, then F(s) G(s) is defined and rep a) = § Fae. SUMMATORY FUNCTIONS 81 Proof. It is known that the product series is absolutely convergent under the given conditions, so the terms in the product series may be rearranged without affecting the sum. Let ne + be arbitrary. If n = ab is any factoriz- ation of n into positive integers, the series (14) contains a term a) 2(b fla) (6) arb = LO8O) Selecting out of (14) all such terms for factorizations of n, we see that (14) contains 5 LA = 5. gyn ab=n and no other terms with n~* involved. Since n was arbitrary, we have =~ fan) Fs) Gis) = n=1 Remark. If s > 1, the Dirichlet series ¢(s) = Lig(n)n-* = L1/n* is the Riemann zeta function. It is known that (2) = 17/6 and (4) = 2*/90. Corollary 23.2a. oon ~ Fs)’ s>1 Proof. H{n) ton) tol) — eln) rete hay eo Le Applying definitions, we have (Zp(n)n~*)e(s) = 1. Corollary 23.2b. Hn) 6 1 ye et? 1 Proof. wn) _ in) Sn) » n* = 2 n° ne n? 1 ~@* 28 82 THE THEORY OF NUMBERS: AN INTRODUCTION Putting the appropriate results into (11) we obtain the following. Theorem 23.3. 3x? ¥ oln) = > + O(log x) nsx nu Our next theorem is an example of a somewhat different type of application of Theorem 23.2. Before proceeding, the reader should review Theorem 14.3. Theorem 23.4. If's > 1 and if c,(d) is Ramanujan’s trigonometric function, then C221) gy Fld) no i“ Proof. ~ c,d) = Lo c,(d) d es) Ss is Ss Qe ke 7 Ra 1 n\t—} roar # = = 779%s-1(n) EXERCISES 23-1. Prove that if f(n) = O(1) and s> 1, then Lf(n)n~* is absolutely convergent. 23-2. Fill in the details of the proof of Theorem 23.3. 23-3. Find an asymptotic expression for Z, .,(n)n 4. 23-4. If sand kare suitably restricted, prove (a) 07(s) = Ze(n)n™° (b) f(s) &(s — 1) = Le(n)n™ (c) [(s) o(s — k) = Lox(n)n* (d) ls — 1s) = Len) n-* 23-5. Consider again the asymptotic formula of Exercise 20-3. Show that the limit of the left side as x — oo is the infinite series (2), and the limit of the right side is the constant K of Exercise 20-3. 24. Squarefree Integers We have shown that ;7(n)is 1 if n is squarefree, 0 otherwise. Hence Z,, .,. u7(n) is the number of squarefree integers not exceeding x, and we will now study this function. We first notice that wn) = & Hd) SUMMATORY FUNCTIONS 83 because n can be written uniquely in the form n = N7q, q squarefree. Hence, © Hd) = 3) ud) = &(N) = p(n). ain d|N Theorem 24.1. 6x L #0) = + OX) nsx Proof. 1n the summations below, we are summing (in two ways) over the lattice points, whose first coordinate is a square, in the region bounded by u=1/2,v = 1/2, and uv = x. LFo@= FY Yee nsx n 0; also, since — 1\2 O 1. If mis even, then we may assume that X;=X2(mod2) and x; = x, (mod 2). That is, if m is even, then either none, two, or four of the x; are even and we may choose notation so that the above congruences hold. Then x, +x)? xX, — x2)? x3 + x4)? X3—X4)2 =m 1+ X2 ' 1 24° )% + 4 133 ate Mm, 2 2 2 2 2 is a representation of (m/2)p as a sum of the squares of four integers; by the way m was chosen, from (2) we conclude that Xy +X. Xy— Xq Xe t+ Xq_ Xz — Ny _ 7 = > = 7 = z = 0(mod p). But then XytXq Xy — X2 + 2 ~ 2 = 0(mod p) implies that x; = x, = 0; similarly, x, = x4, = 0(mod p) and this contra- dicts (2). Hence m is odd. Since m > 3 by assumption, we can find y, in an absolutely least CRS (mod m), ie. |y| < m/2, such that y; = x;(mod m) for j = 1, 2,3, 4. Equiv- alently, there exist m, such that (3) ypHx,tmm j= 1,2,3,4. 86 THE THEORY OF NUMBERS: AN INTRODUCTION Now 4 Lyi = Lx + 2m y! xyn; + m? mj i=1 = }' x} = 0(mod m). Therefore, for some M we have Mm = Ly}. Since |y| < m/2, 0 < Mm < 4(m/2y = m?. If M = 0, then y,; = 0 for all j. But then from (3), x; = —mm, and from (2) we get mp = m’X(—m,)*, or mlp, which is impossible. Therefore, 0 < Mm < m’*,so0 1, we call n = x? + y? an imprimitive representation. It is obvious that not every integer can be written as a sum of two squares. For example, 3 = x? + y? has no solution x,y in integers. We will first determine necessary and sufficient conditions for ne + to be represented as a sum of two squares. When n can be so represented, we will determine the number of ways in which this can be done. Lemma 26.1. Suppose ne &*. If there is a prime q such that q|n and q = 3 (mod 4), then n has no primitive representation as a sum of two squares. Proof. Suppose there exists a prime q such that q|n, q = 3 (mod 4), and n= x? + y’ is a primitive representation. Evidently, qx and q/y, because if, say, q[x, then q|(n — x?) = y?, so qly, which contradicts our assumption that (x,y) = 1. Since (x,q) = 1, we know by Corollary 12.2 that there is some u such that y = ux (mod q). Then x21 + u?) = x? + u?x? = x? + y? =n = 0(mod g), so that 1 + u? = 0, or v2 = —1 (mod q). Thus (—1/q) = 1. But q is of the form q = 3 (mod 4) and by Euler’s criterion (= 1/4) = (1) P? = = 1. Therefore, n has no primitive representation. 88 THE THEORY OF NUMBERS: AN INTRODUCTION Theorem 26.1. If q is prime, q = 3 (mod 4), q"\|n, « odd, then n has neither primitive nor imprimitive representations as a sum of two squares. Proof. Suppose n = x? + y” and (x,y) = d. Say q*|id, B = 0. Let x = Xd, y= Yd, with (X,Y)=1. We have n = d*(X? + Y’) = d?N, say. Since q*”*||N, we have a contradiction because « — 28 is odd, hence >1, and alN, N = X? + Y? is a primitive representation, which is impossible by the preceding lemma. The problem of writing any n as a sum of two squares may be facilitated by using the identity , (5) (xt + x3)(vt + y2) = (xii + X2¥2)? + iy2 — Xai)’ which tells us that ifn, and n2 are each representable as a sum of two squares, then so is n,n2. Ifmis any positive integer, suppose the canonical form is n= 2*T] pi [1 af? where p; = 1 (mod 4) and q; = 3 (mod 4). We know from Theorem 26.1 that B; must be even for all j if n is to have a representation; indeed, if B, is even, then qj! = {q\'/"s}? + 0? is a representation of gf/, and by using (5) we can write IIg#/ as a sum of two squares when the B; are even. Also 2 = 1* + 1? together with (5) shows that every power of 2 is a sum of two squares. Now we will prove that if p = 1 (mod 4), then p = x” + y” has a solution x,y é &. For this, we require the following lemma. Lemma 26.2. If z is real and n is a positive integer, then there are integers aand b such that a 1 ——|<-——., l bas " Proof. Consider the numbers o, = kz — [kz], k = 0,1,...,n. Obviously, O0 j, take b = k — jand a = [kz] — [jz] — r,andifk b|0, B>0, ist je DP, = 1 (mod 4), q; = 3 (mod 4). The equation n = x? + y” has an integral solu- tion x,y if and only if B, is even for j = 1,...,s. Example. For n = 2°5-13-117, we note that 27 = 27 + 27,5 = 2? + 17, 13 = 2? + 37, and 117 = 117 + 02. Now by successive applications of (5) we have 235 = (2? + 27727 + 13 (442% + (2-47 = 6 + 2, (235)13 = (6? + 27)(2? + 37) = (12 + 6)? + (18 — 4)? = 18? + 14?, (235-13)11? = (182 + 142)(112 + 07) = (198 + 0)? + — 154). EXERCISES 26-1.* Show that 27* = (42%)? +0? and 27*+! = (42%)? + (42%) are the only representations as sums of two squares for powers of 2. 26-2. Express 45, 325, and 5929 as a sum of two squares. 26-3. Prove that for every Be 2*, the equation 374 = x? + y? has only the four solutions x = +3, y= Qandx =0,y = +34 90 THE THEORY OF NUMBERS: AN INTRODUCTION 27. Number of Representations Exercise 26-1 shows that a power of 2 may be written as a sum of two squares in four ways, namely, 27* = (2%)? + 0? = (—2%)? + 0? = 0? + (2° = 0? + (—2%)?. This is a special case of the general problem which we now consider: If ne #*, in how many ways can n be written as a sum of two squares? Suppose n= 2° TT pk TT a} k=1 Jet where « > 0, py = 1(mod4), g; = 3 (mod 4). For convenience we write ny = IIpf* and nz = 11g}, so we have n = 2"n,no. Theorem 27.1. If n is as above, then the number N(n) of ways in which n can be written as a sum of two squares is 4t(n,) ifn, is a square; N(n) = . 0 ifn is not a square. The proof of this theorem will be postponed until we investigate some of the properties of the Gaussian integers in the next section. 28. The Gaussian Integers A Gaussian integer is a complex number of the form a + bi, where abe and i? = —1. Let Y denote the set of all Gaussian integers. Two Gaussian integers a + biand c + di are equal if and only if a = cand b = d. Addition, subtraction, and multiplication in Y are defined just as these operations are defined on the set of all complex numbers, namely (a+ b)+(c+d)=(Qte+ (bt Ai (a + bi)(c + di) = (ac — bd) + (ad + be). Evidently, ifa,fe Y, thena + Band afe G. Also, the set ¥ of rational integers is a subset of G and the multiplicative identity in Y is the (Gaussian) integer 1. A Gaussian integer « is called a unit in Y if and only if there exists Be Y such that «B = 1. A mapping D, called the norm, from ¥ into the set of non-negative rational integers is defined by D(a + bi) = a? + b?. This function has the property that D(«B) = D(a) D(B) for all «6 € Y (the proof is left as an exercise). Thus it is easy to see that o is a unit in Y only if D(a)|D(1) = 1, hence only if D(«) = 1, since D(a) > 0. But if = a + bi, D(a) = a? + b? = 1 implies eithera = +1 SUMS OF SQUARES 91 and b = 0, or a= O and b = +1. Therefore, if « is a unit, « must be of the form +1 or +i. Clearly, these four numbers are units and hence the only units in Y. We notice that o is a unit if and only if D(a) = 1, and the units are all of the form i, ne &. Two integers «,f € are called associates if a = By for some unit y. Thus a and £ are associates if and only ifa = +Bora = +fi. IfafpeG we say a divides B, and write «|8, if and only if there exists yeY such that ay = B. Clearly a unit is a divisor of every Gaussian integer. A non-zero, non-unit element a € Y is called a prime if the only divisors of « are units or associates of a. If ae Y andD(q) is a rational prime, then « is prime in & for if « = By is any factorization, then D(a) = D(8) D(y) and since D(a) is a prime in %, either D(f) or D(y) = 1. We will show later that there are primes de Y such that D(6)€ & is composite. Example. The Gaussian integers 1+ i, 2+ i, 1 — i, 2—i are primes in Y since their norms are prime in & The primes 1 + i and 1 — i are associated, since (1 + )(-) =1—i. Every element of Y which is not zero and not a unit can be factored into primes, as we now show. Let « # 0,@ nota unit. If wis a prime, weare through. If « is not a prime, then o has a representation of the form « = fy with D(f) > land D(y) > 1. Evidently we also have D(f) < D(a) and D(y) < D(a) since D(a) = D(f) D(y). Now if 8 and y are not primes, we may continue the factorization process. Since the norms of the factors form a strictly decreasing sequence of positive integers, the process must terminate when every further factorization involves a factor whose norm is 1. Thus, a non-zero, non-unit in Y may be written as a product of primes in Y To show that this factorization is essentially (except for order and the occurrence of units and associates) unique, we require the Gaussian analogue of the division algorithm for rational integers. Theorem 28.1. If «Be, B #0, then there exist 4,0E9 such that a = BA + @, D(8) < D(8). Proof. The proof is greatly facilitated by operating in the set of all complex numbers, rather than in the set @ Recall that ify is a complex number, y has a unique representation of the form y = x + yi with x,y real. Also, the conjugate 7 of y is the complex number 7 = x — yi. Equality, addition (and subtraction), and multiplication of complex numbers are defined just as these concepts are defined in G and if y=x+ yi, d=u+ vi, d #0 are complex numbers, then division y/6d is defined by y_ xXut yo yu xv, = i. 6 weet ae 92 THE THEORY OF NUMBERS: AN INTRODUCTION Finally, the modulus |y| of a complex number y is defined by |y| = (y7)'/2. In particular, notice that if the complex number a is also a Gaussian integer, then D(a) = |a|? = aa. Now suppose a,fe%9 8 4 0. Then a/f is defined and is some complex number, say o/B = x + yi where x and y are rational. We now choose rational integers m and n such that |x — m| < 1/2, |y — n| < 1/2. This can be done by using Lemma 26.2 with the n of that lemma equal to 1. Take 1 = m+ ni and @ = a — BA. We must show that D(@) < D(§). But we have lal = le — Ba) = [Bl 5 — 2] = [Al — m +O ~ my = |BI{(x — m? + (y — n)?}1? < |BI{G)? + @)?}'? < |B). Hence D(0) = |@|? < |p|? = Dip). With this theorem we can define a Euclidean algorithm in ¢ as follows. Suppose «fe Y B # 0. We find integers in Y such that a= Bay + x1, D(x,) < D(B) B=x142. + X2, D(x2) < D(x) Xn-2 = Xn-14n + Xns D(Xn) < D(Xn-1) Xn-1 = Xpdn 1 + Xn41> D(Xn+1) = 0. The process must terminate with some remainder x,,, ; such that D(x,+1) = 0, since the norms form a strictly decreasing sequence of non-negative rational integers. The remainder x, isa common divisor of aand £, and every common divisor divides x,. Hence, we call x, a greatest common divisor of a and B and write x, = («,8). This gcd is not unique, since any associate of x, is also a gcd. However, any two gcd’s must be associates, for suppose y = («,f) and 6 = (a,B). Then y|6, say yo = 6, and dly, say 6x = y. Therefore y = dx = yor, so on = 1,a isa unit and y and 6 are associates. The Euclidean algorithm allows us to prove that if (,8) = 1 and o|By, then aly. In addition, then, if « is a prime in Y and oy, either of or oly. This in turn yields a proof of the essential uniqueness of factorization in G The details are very similar to the proof of the same theorem for rational integers, and are omitted here. SUMS OF SQUARES 93 Theorem 28.2. If «e€@ is a non-zero, non-unit, then a can be written as a product of primes in Y and the factorization is essentially unique. We consider now the problem of determining the primes in & We have already shown that 1 + i,1 — i, —1 + i,and —1 — iareall prime in ¥ since the norms are 2, and evidently these primes are associates. Suppose q is a rational prime and q = 3(mod4). Let q = «8 be any factorization of q in Y. We then have D(q) = q? = D(a) D(f). By unique factorization of rational integers, either D(«) = 1, g, or q*. If D(a) = 1, then « is a unit; also, if D(a) = q?, then B is a unit. If D(a) = D(f) = gq, and if a= a+ bi, then D(«) = q = a® + b*. But q has no representation as a sum of two squares. Therefore, every factorization of q = 3 (mod 4) involves a unit factor, so q is prime in Y. Note that D(q) is not a rational prime. Suppose p is a rational prime, p = 1 (mod 4). We recall that p can be written as a sum of squares, say p = a? + b®. Thus, in Y we have the factori- zation p = (a + bi)(a — bi). Notice that a + biand a — biare not associates, for if they were, we would have (a + bi)” = a — bi for some n, 0

Você também pode gostar