25906871 introduction to the theory of numbers

Upload: james-lanham

Post on 02-Apr-2018

214 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/27/2019 25906871 Introduction to the Theory of Numbers

    1/312

  • 7/27/2019 25906871 Introduction to the Theory of Numbers

    2/312

    r.

    o512.81 N7313 73-50666NivenAn introduction to the theoryof numbers

    kansas city public librarykansas city, missouri

    Books will be issued onlyon presentation of library card.

    Please report lost cards andchange of residence promptly.

    Card holders are responsible forall books, records, films, pictures

    or other library materialschecked out on their cards.

  • 7/27/2019 25906871 Introduction to the Theory of Numbers

    3/312

    DATE DUE :i6

    DEC 06IL 2 o 1994

    I

    1 t993 MAI SEP 16

  • 7/27/2019 25906871 Introduction to the Theory of Numbers

    4/312

  • 7/27/2019 25906871 Introduction to the Theory of Numbers

    5/312

    An Introduction tothe Theory of Numbers

  • 7/27/2019 25906871 Introduction to the Theory of Numbers

    6/312

    Books by Ivan Niven

    Calculus: An Introductory Approach (Van Nostrand)Diophantine Approximations (Wiley)Irrational Numbers (Wiley)Mathematics of Choice (Random House)Numbers : Rational and Irrational (Random House)

  • 7/27/2019 25906871 Introduction to the Theory of Numbers

    7/312

    An Introduction tothe Theory of Numbers

    Third Edition

    IVAN N.IVENUniversity of OregonHERBERT S. ZUCKERMANUniversity of Washington

    JOHN WILEY & SONS INCNew York London Sydney Toronto

  • 7/27/2019 25906871 Introduction to the Theory of Numbers

    8/312

    Copyright I960, 1966, 1972 by John Wiley & Sons, Inc.All rights reserved. Published simultaneously in Canada.No part of this book may be reproduced by any means,nor transmitted, nor translated into a machine languagewithout the written permission of the publisher.Library of Congress Catalog Card Number: 73-178149ISBN 0-471-64154-5Printed in the United States of America.10 987654321

  • 7/27/2019 25906871 Introduction to the Theory of Numbers

    9/312

  • 7/27/2019 25906871 Introduction to the Theory of Numbers

    10/312

    Preface to the First Edition

    Our purpose is to present a reasonably complete introduction to the theoryof numbers within the compass of a single volume. The basic concepts arepresented in the first part of the book, followed by more specialized materialin the final three chapters. Paralleling this progress from general topics tomore particular discussions, we have attempted to begin the book at a moreleisurely pace than we have followed later. Thus the later parts of the book areset forth in a more compact and sophisticated presentation than are theearlier parts.The book is intended for seniors and beginning graduate students inAmerican and Canadian universities. It contains at least enough materialfor a full year course; a short course can be built by the use of Sections 1.1to 1.3, 2.1 to 2.4, 3.1, 3.2, 4.1, 5.1 to 5.3, 5.5, 6.1, and 6.2. Various otherarrangements are possible because the chapters beyond the fourth are,apart from a very few exceptions, independent of one another. The finalthree chapters are entirely independent of each other.To enable the student to deepen his understanding of the subject, we haveprovided a considerable number of problems. The variety of these exercisesis extensive, ranging from simple numerical problems to additional developments of the theory. The beginner at number theory should take warningthat the subject is noted for the difficulty of its problems. Many an innocent-looking problem gives, by the very simplicity of its statement, very littlenotion of the considerable

    ingenuityor depth

    ofinsight required

    for its solution. As might be expected, the more difficult problems are placed toward theends of the sets. In many instances three or four consecutive problems constitute a related series in which the last ones can be solved more readily by useof information from the first ones. As a matter of principle we have made thetext itself entirely independent of the problems. In no place does the proof ofa theorem depend on the results of any problem.

    In choosing methods of proof, we have tried to include as many methodsas possible. We have tried to state the proofs accurately, avoiding statementsthat could be misleading and also avoiding unduly long discussions of unimportant details. As the reader progresses he will become familiar withmore and more methods, and he should be able to construct accurate proofsby patterning them after our proofs.vi

  • 7/27/2019 25906871 Introduction to the Theory of Numbers

    11/312

    Preface to the First Edition viiThe reader interested in further exploration of the subject will find the

    bibliography at the end of the book of considerable use. In particular, anyone interested in the history of the subject should consult O. Ore, NumberTheory and Its History, and, for more specific information, L. E. Dickson,History of the Theory ofNumbers. Our approach is analytical, not historical,and we make no attempt to attribute various theorems and proofs to theiroriginal discoverers. However, we do wish to point out that we followed thesuggestion of Peter Scherk that we use F. J. Dyson's formulation of the proofof Mann's a/? Theorem. Our proof is based on notes graciously placed at ourdisposal by Peter Scherk. For permission to use several problems from theAmerican Mathematical Monthly, we are indebted to the editors. We alsoappreciate the careful reading of the manuscript by Margaret Maxfield,whose efforts resulted in numerous improvements. Finally we would like torecord our deep appreciation of and our great debt to the mathematicianswhose lectures were vital to our introduction to the theory of numbers: L. E.Dickson, R. D. James, D. N. Lehmer, and Hans Rademacher.June 1960 IVAN NIVEN

    HERBERT S. ZUCKERMAN

  • 7/27/2019 25906871 Introduction to the Theory of Numbers

    12/312

  • 7/27/2019 25906871 Introduction to the Theory of Numbers

    13/312

    Contents

    1. Divisibility 1

    1.1 Introduction 11.2 Divisibility 21.3 Primes 10

    2. Congruences 202.1 Congruences 202.2 Solutions of Congruences 272.3 Congruences of Degree I 292.4 The Function (n) 342.5 Congruences of Higher Degree 372.6 Prime Power Moduli 392.7 Prime Modulus 432.8 Congruences of Degree Two, Prime Modulus 462.9 Power Residues 462.10 Number Theory from an Algebraic Viewpoint 512.11 Multiplicative Groups, Rings, and Fields 56

    3. Quadratic Reciprocity 633.1 Quadratic Residues 633.2 Quadratic Reciprocity 673.3 The Jacobi Symbol 71

    4. Some Functions of Number Theory 784.1 Greatest Integer Function 784.2 Arithmetic Functions 844.3 The Moebius Inversion Formula 88

    IX

  • 7/27/2019 25906871 Introduction to the Theory of Numbers

    14/312

    Contents4.4 The Multiplication of Arithmetic Functions 914.5 Recurrence Functions 96

    5. Some Diophantine Equations 1005.1 Diophantine Equations 1005.2 The Equation ax + by = c 1015.3 Positive Solutions 1025.4 Other Linear Equations 1045.5 TheEquationx2 + y2 = z2 1055.6 The Equation x4 + y4 = *2 1075.7 Sums of Four and Five Squares 1095.8 Waring's Problem 1125.9 Sum of Fourth Powers 1125.10 Sum of Two Squares 1135.11 The Equation 4x2 + f = n 1185.12 The Equation ax2 + bf + cz2 = 1205.13 Binary Quadratic Forms 1235.14 Equivalence of Quadratic Forms 127

    6. Farey Fractions and Irrational Numbers 1346.1 Farey Sequences 1346.2 Rational Approximations 1376.3 Irrational Numbers 1426.4 Coverings of the Real Line 147

    7. Simple Continued Fractions 1507.1 The Euclidean Algorithm 1507.2 Uniqueness 1527.3 Infinite Continued Fractions 1537.4 Irrational Numbers 1577.5 Approximations to Irrational Numbers 1597.6 Best Possible Approximations 1637.7 Periodic Continued Fractions 1667.8 Pell's Equation 1727.9 Numerical Computation 175

  • 7/27/2019 25906871 Introduction to the Theory of Numbers

    15/312

    Contents x |8. Elementary Remarks on the Distribution of Primes 178

    8.1 The Function TT(X) 1788.2 The Sequence of Primes 1818.3 Bertrand's Postulate 185

    9. Algebraic Numbers 1889.1 Polynomials 1889.2 Algebraic Numbers 1929.3 Algebraic Number Fields 1959.4 Algebraic Integers 1999.5 Quadratic Fields 2019.6 Units in Quadratic Fields 2039.7 Primes in Quadratic Fields 2049.8 Unique Factorization 2069.9 Primes in Quadratic Fields Having the Unique

    Factorization Property 2089.10 The Equation x3 + y3 = z3 213

    10. The Partition Function 21910.1 Partitions 21910.2 Graphs 22010.3 Formal Power Series and Euler's Identity 22310.4 Euler's Formula 22710.5 Jacobi's Formula 23310.6 A Divisibility Property 236

    11. The Density of Sequences of Integers 24011.1 Asymptotic Density 24111.2 Square-Free Integers 24311.3 Sets of Density Zero 24611.4 Schnirelmann Density and the a/? Theorem 250

  • 7/27/2019 25906871 Introduction to the Theory of Numbers

    16/312

    xii ContentsMiscellaneous Problems 255

    Special Topics 259Periodic decimals, Unit fractions, The equationx~n 4. y~n = z~n j Gauss's generalization of Fermat'stheorem, Primitive root mod p by group theory, Thegroup of rational points on the unit circle, The dayof the week from the date, Some number theoreticdeterminants, Gaussian integers as sums of squares,Unique factorization in Gaussian integers, TheEisenstein irreducibility criterion.

    General References 269

    Answers to Problems 271

    Index 285

  • 7/27/2019 25906871 Introduction to the Theory of Numbers

    17/312

    An Introduction tothe Theory of Numbers

  • 7/27/2019 25906871 Introduction to the Theory of Numbers

    18/312

  • 7/27/2019 25906871 Introduction to the Theory of Numbers

    19/312

    1

    Divisibility

    1.1 IntroductionThe theory of numbers is primarily concerned with the properties of thenatural numbers, 1, 2, 3, 4, - , also called the positive integers. However,the theory is not strictly confined to just the natural numbers or even to theset of all integers: 0, 1, 2, 3, - - . In fact, some theorems of numbertheory are most easily proved by making use of the properties of real orcomplex numbers even though the statement of the theorems may involveonly natural numbers. Also, there are theorems concerning real numbersthat depend so heavily on the properties of integers that they are properlyincluded in the theory of numbers.An integer n greater than 1 is called a prime if it has no divisor d such that1 < d < n. The fact that for every given positive integer m there is a primegreater than m is stated in terms of integers, and it can be proved from theproperties of the natural numbers alone. The fact that every natural numbercan be expressed as a sum of, at most, fifty-four fifth powers of integers isalso stated in terms of natural numbers, but any known proof depends onproperties of complex numbers. Finally, the question as to how many primesthere are that do not exceed x clearly belongs to the theory of numbers but itsanswer involves the function log x and is well outside of the realm of thenatural numbers. The last two examples are beyond the scope of this book.However, we do not restrict ourselves to the integers but will use real andcomplex numbers when it is convenient. The questions discussed in this bookare not numerical computations or numerical curiosities, except insofar asthese are relevant to general propositions. Nor do we discuss the foundationsof the number system; it is assumed that the reader is familiar not only with

  • 7/27/2019 25906871 Introduction to the Theory of Numbers

    20/312

    2 Divisibilitythe integers, but also with the rational and real numbers. However, a rigorouslogical analysis of the real-number system is not prerequisite to the study ofnumber theory.The theory ofnumbers relies for proofs on a great many ideas and methods.Of these, there are two basic principles to which we draw especial attention.The first is that any set ofpositive integers has a smallest element if it contains

    any members at all. In other words, if a set S ofpositive integers is not empty,then it contains an integer s such that for any member a of S, the relations ^ a holds. The second principle, mathematical induction, is a logicalconsequence of the first.* It can be stated as follows: if a set S of positiveintegers contains the integer 1, and contains n + I whenever it contains ,then 5 consists of all- the positive integers.

    It may be well to point out that a negative assertion such as, for example,"Not every positive integer can be expressed as a sum of the squares of threeintegers," requires only that we produce a single example the number 7cannot be so expressed. On the other hand, a positive assertion such as"Every positive integer can be expressed as a sum of the squares of fourintegers," cannot he proved by producing examples, however numerous.This result is Theorem 5.6 in Chapter 5, where a proof is supplied.

    Finally, it is presumed that the reader is familiar with the usual formulationof mathematical propositions. In particular, if A denotes some assertion orcollection of assertions, and B likewise, the following statements are logicallyequivalent they are just different ways of saying the same thing.A implies B.

    If A is true, then B is true.In order that A be true it is necessary that B be true.B is a necessary condition for A.A is a sufficient condition for B.

    If A implies B and B implies A 9 then one can say that B is a necessary andsufficient condition for A to hold.In general, we shall use letters of the roman alphabet, a, b, c, ,m, /2, , as, y 9 z, to designate integers unless otherwise specified.

    1.2 Divisibility

    Definition 1.1 An integer b is divisible by an integer a, not zero, if there is aninteger x such that b = ax, and we write a\b. In case b is not divisible by awe write a Jf b.* Compare G. Birkhoff and S. MacLane, A Survey of Modern Algebra, Macmillan,third edition, 1965, pp. 10-13.

  • 7/27/2019 25906871 Introduction to the Theory of Numbers

    21/312

    1.2 Divisibility 3Other language for the divisibility property a \ b is that a divides b, thata is a divisor of b, and that b is a multiple of a. If | b and < a < b then a

    is called a proper divisor of*. It is understood that we never use as the leftmember of the pair of integers in a \ b. On the other hand, not only mayoccur as the right member of the pair, but also in such instances we alwayshave divisibility. Thus a \ for every integer a not zero. The notation aK || bis sometimes used to indicate thatf

    \b but aK+l \ b.

    Theorem 1.1(1) a b implies a \ befor any integer c;(2) a | b and b \ c imply a \ c;(3) a | b and a \ c imply a \ (bx + cy)for any integers x and y;(4) a b and b

    \a imply a = b;

    (5) a | b, a > 0, b > 0, imply a 0,there exist unique integers q and r such that b qa + r, ^ r < #. Ifa\b,then r satisfies the stronger inequalities < r < a.Proof. Consider the arithmetic progression

    , b - 30, b - 20, b - a, b, b + a, b + 2a, b + 3a, - -extending indefinitely in both directions. In this sequence, select the smallestnon-negative member and denote it by r. Thus by definition r satisfies theinequalities of the theorem. But also r, being in the sequence, is of the formb qa, and thus q is defined in terms of r.To prove the uniqueness of q and r, suppose there is another pair q1 and rxsatisfying the same conditions. First we prove that rx = r. For if not, we maypresume that r < r so that < rx r < a, and then we see that ^ r =a( 0. However, thishypothesis is not necessary, and we may formulate the theorem without it:given any integers a and Z>, with a ^ 0, there exist integers q and r such thata.

  • 7/27/2019 25906871 Introduction to the Theory of Numbers

    22/312

    4 DivisibilityTheorem 1.2 is called the division algorithm. An algorithm is a mathe

    matical procedure or method to obtain a result. We have stated Theorem 1.2in the form "there exist integers q and r," and this wording suggests that wehave a so-called existence theorem rather than an algorithm. However, itmay be observed that the proof does give a method for obtaining the integersq and r, because the infinite arithmetic progression , b a, b, b + a, - -need be examined only in part to yield the smallest positive member r.

    In actual practice the quotient q and the remainder r are obtained by thearithmetic division of a into b.Definition 1.2 The integer a is a common divisor ofb and c in case a \ b anda

    |c. Since there is only a finite number of divisors of any non-zero integer,

    there is only a finite number ofcommon divisors ofb and c 9 except in the caseb = c = 0. Ifat least one ofb and c is not 0, the greatest among their commondivisors is called the greatest common divisor of b and c and is denoted by(b, c). Similarly we denote the greatest common divisor g of the integers15 62 , ' ' ' , bn , not all zero, by (bl9 4a , , *).Thus the greatest common divisor (b, c) is defined for every pair of integers

    b, c except b = 0, c = 0, and we note that (b, c)ll.Theorem 1.3 Ifg is the greatest common divisor ofb and c, then there existintegers % andyQ such that g = (b, c) = to + cyQ .Proof. Consider the linear combinations bx + cy, where x and y range overall integers. This set of integers {bx + cy} includes positive and negativevalues, and also by the choice x y = 0. Choose XQ and yQ so thatbx + cyQ is the least positive integer / in the set; thus / = bx + cy$.Next we prove that / 1 b and / 1 c. We establish the first of these, and

    the second follows by analogy. We give an indirect proof that / 1 b, that is,we assume lj(b and obtain a contradiction. From / Jfb it follows that thereexist integers q and r, by Theorem 1.2, such that b = Iq + r with < r < /.Hence we have r = b - Iq = b - q(bx + cy ) = 6(1 - qx ~) + c(-qyQ),and thus r is in the set {bx + cy}. This contradicts the fact that / is the leastpositive integer in the set {bx + cy}.Now since g is the greatest common divisor of b and c, we may writeb = gB, c = gC 9 and / = bx + cyQ = g(Bx + Q/ ). Thus g \ /, and so bypart 5 ofTheorem 1.1 , we conclude thatg- ^ /. Nowg < /is impossible, sinceg is the greatest common divisor, and so g = / = bxQ + cyQ .Theorem 1.4 The greatest common divisor gofb and c can be characterizedin thefollowing two ways: (1) it is the least positive value ofbx + cy where xandy range over all integers; (2) it is the positive common divisor ofb and cwhich is divisible by every common divisor.

  • 7/27/2019 25906871 Introduction to the Theory of Numbers

    23/312

    1.2 Divisibility 5

    Proof. Part 1 follows from the proof of Theorem 1.3. To prove part 2, weobserve that if d is any common divisor of b and c, then d\ g by part 3 ofTheorem 1.1. Moreover, there cannot be two distinct integers with property

    2, because of Theorem 1.1, part 4.Theorem 1.5 Given any integers bly b2 , - , bn not all zero, with greatestcommon divisor g, there exist integers xl9 #2 , , xn such that

    Furthermore, g is the least positive value of the linearform 25U b$j where theyj range over all integers; also g is thepositive common divisor ofbly b2 ,

    -, bn

    which is divisible by every common divisor.Proof. This result is a straightforward generalization of the preceding twotheorems, and the proof is analogous without any complications arising inthe passage from two integers to n integers.Theorem 1.6 For any positive integer m,

    (ma, mb) m(a, b).Proof. By Theorem 1.4 we have

    (ma, mb) = least positive value of max + mby= m - {least positive value of ax + by}= m(a, b).Theorem 1.7 Ifd \ a and d \ b and d > then

    d d dIf(a,b) =g, then

    Proof. The second assertion is the special case of the first obtained by usingthe greatest common divisor g of a and b in the role of d. The first assertionin turn is a direct consequence of Theorem 1.6 obtained by replacing m, a, bin that theorem by d, (aid), (bid) respectively.Theorem 1.8 If (a, m) = (b, m) = 1, then (ab, m) = 1.Proof. By Theorem 1.3 there exist integers XQ , y0? xl9 y such that 1 =ax + my = bxl + rny-^. Thus we may write (ax^(bx-^ = (1 myQ)(l= 1 ^2/2 where y2 is defined by the equation 2/2 = 3/0 + 2/1

  • 7/27/2019 25906871 Introduction to the Theory of Numbers

    24/312

    6 DivisibilityFrom the equation abx^ + my^ = 1 we note, by part 3 ofTheorem 1.1, thatany common divisor of ab and m is a divisor of 1, and hence (ab, m) = 1.Definition 1.3 We say that a and b are relatively prime in case (a, b) = 1,and that al9 a^ - 9 an are relatively prime in case (al9 a2 , - - , an) = 1. Wesay that al9 a2 , - , an are relatively prime in pairs in case (aiy a^ = 1 for alli = 1 , 2, , n and] = 1 , 2, , n with i ^ j.The fact that (a, b) = 1 is sometimes expressed by saying that a and b are

    coprime, or by saying that a is prime to b.Theorem 1.9 For any x9 (a, b) = (b, a) = (a, -b) = (a,b + ax).Proof. Denote (a, b) by d and (a, b + ax) by g. It is clear that (b, a) =(a, -b) = d.By application of Theorem 1.1, parts 3 and 4, we obtain d\g,g\d, andhence d = g.

    Theorem 1.10 Ifc\ab and (b, c) = 1, then c \ a.Proof. By Theorem 1.6, (ab, ac) = a(b, c) = a. But c

    \ab and c

    \ ac, andso c|a by Theorem 1.4.Given two integers b and c, how can the greatest common divisor g befound? Definition 1.2 gives no answer to this question, and neither doesTheorem 1.3 which merely asserts the existence of a pair of integers x and yQsuch that g = bxQ + CyQ . Ifb and c are small, values of g, z , and y can befound by inspection. For example, if b = 10 and c = 6, it is obvious thatg = 2, and one pair of values for x , y is 2, -3. But if b and c are large,inspection is not adequate except in rather obvious cases like (963 963) = 963and (1000, 600) = 200.

    Consider the case b = 963, c = 657. If we divide c into b we get a quotientq

    ' = 1, and remainder r = 306. Thus b = c# + r, or r = b - cy, in particular 306 = 963 - 1 657. Now (b, c) = (b - cq, c) by replacing a and *by c and # in Theorem 1.9, so we see that(963, 657) = (963 - 1 - 657, 657) = (306, 657).

    The integer 963 has been replaced by the smaller integer 306, and this suggeststhat the procedure be repeated. So we divide 306 into 657 to get a quotient 2and a remainder 45, and(306, 657) = (306, 657 - 2 306) = (306, 45).

    Next 45 is divided into 306 with quotient 6 and remainder 36, then 36 isdivided into 45 with quotient 1 and remainder 9. We conclude that(963, 657) = (306, 657) = (306, 45) = (36, 45) = (36, 9).

  • 7/27/2019 25906871 Introduction to the Theory of Numbers

    25/312

    1.2 Divisibility 7Thus (963, 657) = 9, and we can express 9 as a linear combination of 963 and657 by eliminating the remainders 36, 45, and 306 as follows:

    9 = 45 - 36= 45 - (306 -45-6)= -306 + 7-45= -306 + 7(657 - 306 2)= 7 657 - 15 306= 7 657 - 15(963 - 657)= 22-657- 15-963.

    In terms of Theorem 1.3 where g = (b, c) = bx + cy , beginning withb = 963 and c = 657 we have used a procedure, called the "Euclideanalgorithm," to find g = 9, x = -15, yQ = 22. Of course these values forx and 2/ are not unique: - 15 + 657A: and 22 - 963k will do where k is anyinteger.

    In general, to find the greatest common divisor (b, c) of b and c, and alsointegers x and y satisfying g = (6, c) = bx + o/ , we generalize what isdone in the special case above. By Theorem 1.9, (b, c} = (b, c), and hencewe may presume c positive, because the case c = is very special : (4, 0) = \b\.Theorem 1.11 The Euclidean algorithm. Given integers b and c > 0, we makea repeated application of the division algorithm, Theorem 1.2, to obtain aseries of equations

    b = cql + rl9 < r < c,c = /i?2 + ra , < >*3> < r3 < ra ,/V_a = 0-i- + , < r. < _,

    rAe greatest common divisor (b, c} ofb and c is rj9 the last non-zero remainderin the divisionprocess. Values ofx andy in (b, c) = bxQ + cy^ can be obtainedby eliminating rf__l9 - - , r2 , r^from the set of equations.Proof. The chain of equations is obtained by dividing c into 6, ^ into c,r2 into rl9 , r^ into ^_x . The process stops when the division is exact, thatis when the remainder is zero. Thus in our application ofTheorem 1.2 we havewritten the inequalities for the remainder without an equality sign. Thus, forexample, < r < c in place of ^ rx < c, because if rx were equal to zero,the chain would stop at the first equation b = cql9 in which case the greatestcommon divisor of b and c would be c.

  • 7/27/2019 25906871 Introduction to the Theory of Numbers

    26/312

    DivisibilityoWe now prove that r, is the greatest common divisor g of b and c. ByTheorem 1.9 we observe that

    (4, c) = (b - cql9 c) = (r1? c) = (rx , c - rtfj= Ol> r2) = Ol - r2?3, >*2) = (>*3> 'a).Continuing by mathematical induction we get (b,c) = (r^, r,-) = /-,-because r;- is a divisor of r,_l9 and r3 is positive.To see that r, is expressible as a linear combination of b and c, we needmerely eliminate rM from the second and third last equations of the chain,then eliminate r,_a from the third and fourth last, and so on until all of>Vi, 0-2, ' ' , '2, 'i are eliminated. Thus we get r, in the form te + !, 2 , , an].Theorem 1.12 Ifb is any common multiple ofa^ a , , an , then [al9 a& ,an] | 6. 7%w w the same as saying that if h denotes [a l9 a2 , , an ], then0, /7, 2/7, 3A, comprise all the common multiples of a^ 0, [ma, mb] = m[a, b]. Also [a, b] (a, b) = \ab\.Proof. Since [ma, mb} is a multiple of ma, it is & fortiori a multiple of m,and so can be written in the form mh^ Denoting [a, b] by A2 , we note thata

    |/z25 ft

    |/*2 , am | m/72 , im | w/z2 , and so m^ | m/? 2 by Theorem 1.12. Thus

    A! | A2 . On the other hand, 0ra | m//x , bm \ mh^ a \ h l9 b \ h and so A2 | hvWe conclude that Ax = A8 and thus the first part of the theorem is established.It will suffice to prove the second part for positive integers a and b, since

    [a, -b] = [a, b]. We begin with the special case where (a, b) = 1. Now[a] b] is a multiple of a, say ma. Then b \ ma and (a, b) = 1 , so by Theorem1.10 we conclude that fe

    |m. Hence b^m,ba^ma. But Z?a, being a positive

    common multiple of b and a, cannot be less than the least common multiple,and so ba = ma = [a, b].

  • 7/27/2019 25906871 Introduction to the Theory of Numbers

    27/312

    1.2 Divisibility 9Turning to the general case where (a, Z>) = g > 1, we have ((a/g), (%)) =1 by Theorem 1.7. Applying the result of the preceding paragraph, we obtain

    g g\g g/ ggMultiplying by g2 and using Theorem 1.6 as well as the first part of thepresent theorem, we get [a, b\(a, b) = ab.

    PROBLEMS1. By using the Euclidean algorithm find the greatest common divisor (g.c.d.)of(a) 7469 and 2464; (b) 2689 and 4001 ;(c) 2947 and 3997; (d) 1109 and 4999.2. Find the greatest common divisor of the numbers 1819 and 3587, andthen find integers x and y to satisfy1819a5 + 3587s/ = g.3. Find values of x and y to satisfy(a) 243x + l9Sy = 9;(b) llx-50y = 1;(c) 43x + 64y = 1 ;(

  • 7/27/2019 25906871 Introduction to the Theory of Numbers

    28/312

    10 Divisibility17. Evaluate (n, n + 1) and [, n + I] where n is a positive integer.18. Find the values of (a, b) and [a, b] if a and 6 are positive integers suchthat a

    |b.

    19. Prove that any set of integers that are relatively prime in pairs are relativelyprime.20. Given integers a and /3, a number n is said to be of the form ak + b ifthere is an integer k such that ak + b = n. Thus the numbers of the form3k + 1 are - - -8, -5, -2, 1, 4, 7, 10, . Prove that every integer is of theform 3k or of the form 3k + I or of the form 3k + 2.21. Prove that if an integer is of the form 6k + 5 then it is necessarily of theform 3k 1 , but not conversely.22. Prove that the square of any integer of the form 5k + 1 is of the same form.23. Prove that the

    squareof any integer is of the form 3k or 3k + 1 but notof the form 3k + 2.

    24. Prove that no integers x, y exist satisfying x + y - 100 and (x, y) = 3.25. Prove that there are infinitely many pairs of integers x, y satisfyingx + y = 100 and (x, y) = 5.26. Letsand^- > be given integers. Prove that integers x and y exist satisfyingx +y = s and (x 9 y) = g if and only ifg\s.27. Find positive integers a and b satisfying the equations (a, b) = 10 and[a, b] = 100 simultaneously. Find all solutions.28. Find all

    triplesof

    positive integers a, b, c satisfying (a 9 b,c) = 10 and[a, b, c] = 100 simultaneously.29. Let g and / be given positive integers. Prove that integers x and y existsatisfying (x, y) = g and [x, y] = / if and only ifg \ L30. Let b and^- > be given integers. Prove that the equations (x 9 y) = g andxy = b can be solved simultaneously if and only ifg*\b.31. Let n > 2 and k be any positive integers. Prove that (n 1) | (nk 1).32. Let 72 > 2 and k be any positive integers. Prove that (n - I)2 | (72* - 1) ifand only if (/ - 1) | k. Suggestion: nk = {(n - 1) + 1}*.33. Prove that (a, b, c) = ((a, b), c).34. Extend Theorems 1.6, 1.7, and 1.8 to sets of more than two integers.35. Prove that if (b, c) = 1 and r \ b, then (r, c) = 1.36. Prove that if m > n then a*n + 1 is a divisor of a*m - 1. Show that ifa, 777, n are positive integers with m ^ n, then

    , 2m -,2" \ Jl if # is even,12 if a is odd.

    1.3 PrimesDefinition 1.5 An integerp>\is called a prime number, or a prime, in casethere is no divisor d ofp satisfying \

  • 7/27/2019 25906871 Introduction to the Theory of Numbers

    29/312

    1.3 Primes 11Thus, for example, 2, 3, 5, and 7 are primes, whereas 4, 6, 8, and 9 are

    composite.Theorem 1.14 Every integer n greater than I can be expressed as a productofprimes (with perhaps only one factor).Proof. If the integer n is a prime, then the integer itself stands as a "product*'with a single factor. Otherwise n can be factored into, say, n^n^ where1 < 72X < n and 1 < 2 < n. If n is a prime, let it stand; otherwise it willfactor into, say, nzn where 1 < 3 < ^ and 1 < /74 < n^\ similarly for /72 .This process of writing each composite number that arises as a product offactors must terminate because the factors are smaller than the compositenumber itself, and yet each factor is an integer greater than 1. Thus we canwrite n as a product of primes, and since the prime factors are not necessarilydistinct, the result can be written in the form

    where /?1? />2 j ' ' ' ,?r are distinct primes and ocl5 a2 , , ocr are positive.This expression is called a representation of n as a product of primes,and it turns out that the representation is unique in the sense that, for fixed

    n, any other representation is merely a permutation of the factors. It mayappear obvious to the reader that the representation of an integer as aproduct of primes is unique, but it is a fact requiring proof. Indeed there aremathematical situations where it might appear equally "obvious" thatfactorization will be unique, but where in fact it is not. We digress from ourmain theme to discuss two of these situations where factorization is notunique.

    First consider the class E of positive even integers, so that the elements ofE are 2, 4, 6, 8, 10, - . Note that E is a multiplicative system, the productof any two elements in E being again in E. Now let us confine our attentionto E in the sense that the only "numbers" we know are members of E. Then8 = 2 4 is "composite," whereas 10 is a "prime" since 10 is not the productof two or more "numbers." The "primes" are 2, 6, 10, 14, - , the"composite numbers" are 4, 8, 12, . Now the "number" 60 has twofactorings into "primes," namely 60 = 2 30 = 6 10, and so factorizationis not unique.A somewhat less artificial, but also rather more complicated, exampleis obtained by considering the class C of numbers a + b-J 6 where a and b

    range over all integers. We say that this system C is closed under additionand multiplication, meaning that the sum and product of two elements in Care elements of C. By taking b = we note that the integers form a subsetof the class C.

  • 7/27/2019 25906871 Introduction to the Theory of Numbers

    30/312

    12 DivisibilityFirst we establish that there are primes in C, and that every number in C

    can be factored into primes. For any number a + b\] 6 in C it will beconvenient to have a norm, N(a + b\f^6) 9 defined as

    N(a + Z>V^6) = (a + bj^6)(a - &V^6) = a2 + 6b*.Thus thejiorm of a number in Cis the product of the complex numbera + b^j6 and its conjugate a b^J6. Another way of saying this,perhaps in more familiar language, is that the norm is the square of the absolute value. Now the norm of every number in C is a positive integer greaterthan 1, except for the numbers 0, 1, 1 for which we have N(G) = 0, N(l)= 1, N( 1) = 1. We say that we have a factoring of a + b >/ 6 if we canwrite(1.1) a + b^/^6 = (a?! + W^fe + W^),where tffo + y1%/^6) > 1 and N(x2 + yj~^6) > 1. This restriction onthe norms^of the factors is needed to rule out such trivial factorings asa + iV-6 = (l)(a + 6V:iQ = (-l)(-fl-W:: 6). The norm of aproduct can be readily calculated to be the product of the norms of thefactory so that in the^ factoring (1.1) we have N(a + W^6) = N(xl +yd-6)N(x2 + 2/2V~6). It follows that

    1 < N(*i + yJ^S) < N(a + K//Z6),1 < N(x2 + y2v^6J < N(a + bj^6),

    and so any number a + W-6 will break up into only a finite number offactors since the norm of each factor is an integer.We remarked above that the norm of any number in C, apart from and1, is greater than 1. More can be said. Since N(a + W^6) has the valuea2 + 6b2 , we observe that

    0-2) N(a + bJ^6)^6 if b ^ 0,that is, the norm of any complex number in C is not less than 6.A number of C having norm > 1, but which cannot be factored in thesense of (1.1), is called a prime in C. For example 5 is a prime in C. For inthe first place 5 cannot be factored into real numbers in C. In the secondplace, if we had a factoring 5 = (^ + y^^6)(x2 + y*J~^6) into complexnumbers, we could take norms to get

    25 = Nfa + y^^6)N(x, + y2J^6) 9which contradicts (1.2). Thus 5 is a prime in C, and a similar argumentestablishes that 2 is a prime.

  • 7/27/2019 25906871 Introduction to the Theory of Numbers

    31/312

    1.3 Primes 13We are now in a position to show that not all numbers of C factor uniquely

    into primes. Consider the number 10 and its two factorings:10 = 2 5 = (2 + J^6)@ - V-6)-

    The first product 2 5 has factors that are prime in C, as we have seen above.Thus we can conclude that there is not unique factorization of the number10 in C. Note that this conclusion does not depend on our knowing that2 + V~-6 and 2 V 6 are primes; they actually are, but it is unimportantin our discussion.We now return to the discussion of unique factorization in the ordinaryintegers 0, 1, 2, - . It will be convenient to have the following result.Theorem 1.15 Ifp | ab, p being a prime, then p \ a or p | b. More generally,ifp | a:a2 ' an , then p divides at least onefactor jz- of the product.Proof. If p )( a, then (a,p) = 1 and so by Theorem 1.10, p \ b. We mayregard this as the first step of a proof of the general statement by mathematical induction. So we assume that the proposition holds whenever pdivides a product with fewer than n factors. Now ifp \ a^ * an , that is,p | ac where c = #2 1 into primes is unique apartfrom the order of the prime factors.First proof. Suppose that there is an integer n with two different factorings.Dividing out any primes common to the two representations, we would havean equality of the form(1-3)where the factors p t and q, are primes, not necessarily all distinct, but whereno prime on the left side occurs on the right side. But this is impossiblebecause pl \ q^ qs , and so by Theorem 1.15, /?x is a divisor of at leastone of the q^ That is, p must be identical with at least one of the q^.Second proof Suppose that the theorem is false and let n be the smallestpositive integer having more than one representation as the product ofprimes, say(1-4) rt=Pip2-'Pr = M2'"qs-It is clear that r and s are greater than 1. Now the primesp\,p^ ' ' ' >Prno members in common with q^ q^ - - , qs because if, for example, p werea common prime, then we could divide it out of both sides of (1.4) to get two

  • 7/27/2019 25906871 Introduction to the Theory of Numbers

    32/312

    14 Divisibilitydistinct factorings ofnlpv But this would contradict our assumption that allintegers smaller than n are uniquely factorable.

    Next, there is no loss of generality in presuming that p1 < qlt and wedefine the positive integer N as(1.5) N = (ql - pjqfa ,= p^(p^ pr -^3 - - qs).It is clear that N < n, so that N is uniquely factorable into primes. ButPi \ (?i - Pi), so (1.5) gives us two factorings of N, one involving^ and theother not, and thus we have a contradiction.

    In the application of the fundamental theorem we frequently write anyinteger a > 1 in the form, sometimes called the "canonical form,"

    a = P?pt z '-p"rrwhere the primes pi are distinct and the exponents and & ;> 0. Then the greatest common divisor is seen to be

    g = (a, b) = p^iMp n**

  • 7/27/2019 25906871 Introduction to the Theory of Numbers

    33/312

    1.3 Primes 15Note that n is not divisible bypl or p2 or orpr . Hence any prime divisorpof n is a prime distinct fromp^p^ - - ,pr . Since n is either a prime or has aprime factor/?, this implies that there is a prime distinct fiompl ,p2y ,pr .Theorem 1.18 There are arbitrarily large gaps in the series ofprimes. Statedotherwise, given any positive integer k, there exist k consecutive compositeintegers.Proof. Consider the integers

    (k + 1)! + 2, (k + 1)1 + 3, , (k + 1)1 + k, (k + 1)! + k+l.Every one of these is composite because j divides (k + 1)1 + j if 2 ^ y ffc+ 1.The primes are spaced rather irregularly, as the last theorem suggests. Ifwe denote the number of primes that do not exceed x by ir(x) 9 we may ask

    about the nature of this function. Because of the irregular occurrence of theprimes, we cannot expect a simple formula for TT(X). However, one of the moststriking results in advanced number theory, the prime number theorem, givesan asymptotic approximation for TT(X). It states that

    lim 7rOr)^^ = 1,that is, that the ratio of IT(X) to #/log x approaches 1 as x becomes indefinitelylarge.

    PROBLEMS1. With a and b as in (1.6) what conditions on the exponents must be satisfiedifa\b? What conditions if (a, b) = 1 ?2. Observe that the definition that a is square-free amounts to stating that a isdivisible by the square of no integer greater than 1. What is the largest numberof consecutive square-free positive integers? What is the largest number ofconsecutive cube-free positive integers, where a is cube-free if it is divisible bythe cube of no integer greater than 1.3. In any positive integer, such as 8347, the last digit is called the units digit,the next the tens digit, the next the hundreds digit, etc. In the example 8347,the units digit is 7, the tens digit is 4, the hundreds digit is 3, and the thousandsdigit is 8. Prove that a number is divisible by 2 if and only if its units digit isdivisible by 2; that a number is divisible by 4 if and only if the integer formedby its tens digit and its units digit is divisible by 4; that a number is divisible by8 if and only if the integer formed by its last three digits is divisible by 8.4. Prove that an integer is divisible by 3 if and only if the sum of its digits isdivisible by 3. Prove that an integer is divisible by 9 if and only if the sum ofits digits is divisible by 9.

  • 7/27/2019 25906871 Introduction to the Theory of Numbers

    34/312

    16 Divisibility5. Prove that an integer is divisible by 11 if and only if the difference betweenthe sum of the digits in the odd places and the sum of the digits in the evenplaces is divisible by 1 1 .6. Show that

    every positive integer n has a unique expression of the formn = 2rm, r ^ 0, m a positive odd integer.7. Let a/b and c/d be fractions in lowest terms, so that (a, b) = (c, d) = 1.Prove that if their sum is an integer, then \b\ = \d\.8. Prove that any prime of the form 3k + I is of the form 6k + 1 .9. Prove that any positive integer of the form 3k 4- 2 has a prime factor ofthe same form; similarly for each of the forms 4k H- 3 and 6k H- 5.10. If x and y are odd, prove that x2 + y2 cannot be a perfect square.11. If x and y are prime to 3, prove that x2 + y2 cannot be a perfect square.12. Prove that (a, b) = (a,b,a + b) 9 and more generally that (a, b)(a, b, ax + by) for all integers x, y.13. Prove that (a, a + k) \ k for all integers a, k not both zero.14. Prove that (al9 aa , , an) = ((al9 fl2 , , a^ 9 an).15. Prove that (a, a 4- 2) = 1 or 2 for every integer a.16. If (a, b) = /?, a prime, what are the possible values of (a2 , b)l Of (a3 , b)lOf (02 ,Z>3)?17. Evaluate (#,/?4) and (a + A,/?4) given that O,/?2) = /? and (Z>,/?3) = p2where/? is a prime.18. If a and b are represented by (1.6), what conditions must be satisfied by theexponents if a is to be a perfect square ? A perfect cube ? For a \ b ? For a2 \b2 !19. Prove the second part of Theorem 1.13 by use of the g.c.d. and l.c.m.formulas following (1.6).20. Prove that (a2 , b2) = c2 if (a, b) = c.21. Let a and b be positive integers such that (a, b) = 1 and ab is a perfectsquare. Prove that a and Z> are perfect squares. Prove that the result generalizesto kih powers.22. Given (a, b 9 c)[a 9 b, c] = abc, prove that (a, b) = (b, c) = (a, c) = 1.23. Prove that [a 9 b, c](ab, be, ca) = \abc\.24. Determine whether the following assertions are true or false. If true, provethe result, and if false, give a counterexample.(1) If (fl, b) = (a, c) then [a, b] - [a, c].(2) If (a, b) = (a, c) then (a2 , A2) = (a2 , c2).(3) If (a, b) = (*, c) then (a, b) = (a, 6, c).(4) If/? is a prime and/? | a and/? | (a2 + b2) then/? | b.(5) If/? is a prime and/? j a7 then/? | a.(6) If a3 1 c3 then a | c.(7) If a3 1 c2 then a | c.(8) Ifa2 |c3 thena|c.(9) If/? is a prime and/? | (a2 + b2) and/? | (A2 + c2) then/? | (a2 - c2).

    (10) If/? is a prime and/? | (a2 + b2) and/? | (62 + c2) then/? | (a2 + c2).(11) If (a, A) = 1 then (a2 , ab, b2) = 1.(12) [fl2,^,^]"^,^].

  • 7/27/2019 25906871 Introduction to the Theory of Numbers

    35/312

    1.3 Primes 17(13) If b | (a2 + 1) then b \ (a4 + 1).(14) Ifb\(a2 - 1) then Z> | (a4 - 1).(15) (a, 6, c) = ((a, , (a, c)).25. For which

    positive integersTZ is it true that

    26. Given positive integers a and b such that /.29. Obtain a complete list of the primes between 1 and n, with n = 200 forconvenience, by the following method, known as the "sieve of Eratosthenes."By the "proper" multiples of A: we mean all positive multiples of k except kitself. Write all numbers from 2 to 200. Cross out all proper multiples of 2,then of 3, then of 5. At each stage the next larger remaining number is a prime.Thus 7 is now the next remaining larger than 5. Cross out the proper multiplesof 7. The next remaining number larger than 7 is 11. Continuing, we cross outthe proper multiples of 11 and then of 13. Now we observe that the nextremaining number greater than 13 exceeds V200, and hence by the previousproblem all the numbers remaining in our list are prime.30. Consider the set S of integers 1, 2, 3, -,. Let 2k be the integer in Swhich is the highest power of 2. Prove that 2k is not a divisor of any otherinteger in S.31. Prove that %f**i \lj is not an integer if n > 1.32. Consider the set T of integers l,3,5,---,2 1. Let 3 r be the integerin T which is the highest power of 3. Prove that 3r is not a divisor of any otherinteger of T.33. Prove that ^F=i l/(2/ - 1) is not an integer if n > 1.*-34. Say that a positive integer n is a sum of consecutive integers if there existpositive integers m and k so that n = m + (m + 1) + + (m 4- k). Provethat n is so expressible if and only if it is not a power of 2.35. If 2n + 1 is an odd prime, prove that n is a power of 2.36. If 2n 1 is a prime, prove that n is a prime. (Numbers of the formMy = 2P 1, where p is a prime, are called Mersenne numbers, becauseMersenne stated that the only primes p for which My is a prime are p = 2,3, 5, 7, 13, 17, 19, 31, 67, 127, 257. However, M67 andM257 are not primes, forexample, andM61 is a prime. The question of which numbers M% are primes isnot settled.)37. If a and b > 2 are any positive integers, prove that 2 + 1 is not divisibleby2& -1.38. Let positive integers^ and / be given with^- 1 /. Prove that the number ofpairs of positive integers x, y satisfying (#, y) = g and [x, y] = / is 2k , where

  • 7/27/2019 25906871 Introduction to the Theory of Numbers

    36/312

    18 Divisibilityk is the number of distinct prime factors of l\g. (Count xl9 y and x2} y2 asdifferent pairs if x1 ^ x2 or y ^ yz .)39. Let k ^ 3 be a fixed integer. Find all sets alt a%, - , ak of positive integerssuch that the sum of any triplet is divisible by each member of the triplet.40. Proyejhat 2 + V 6 and 2 - V -6 are primes in the class C of numbersa + W-6.41. Prove Theorem 1.13 by use of the fundamental theorem.42. Prove that every positive integer is uniquely expressible in the form

    2'o + 2h + 2> + + 2Vwhere m > and are relatively prime, that is if (a, b) = 1.

    NOTES ON CHAPTER 1The symbol Z is widely used to denote the set of all integers, positive, negative,and zero. Likewise the set of all rational numbers is denoted by g, presumablybecause a rational number is a quotient a/b of integers.

  • 7/27/2019 25906871 Introduction to the Theory of Numbers

    37/312

    Notes on Chapter 1 19It can be noted that the second proof of Theorem 1.16 does not depend onTheorem 1.15 or indeed on any previous theorem. Thus the logical arrangement of

    this chapter could be altered considerably by putting Theorems 1.14 and 1.16 in anearly position, and then using the formulas for (, c) and [b, c] following (1.6) toprove such results as Theorems 1.6, 1.7, 1.8, 1.10, 1.13, and 1.15.The prime number theorem, stated at the end of Section 1.3, is not proved in thisbook. A weaker version due to Tchebychef is given in Theorem 8.1. For a proofof the prime number theorem itself, the reader is referred to the excellent accountsby Hardy and Wright (listed in the General References on page 269) and byNorman Levinson, Amer. Math. Monthly, 76, 225-244 (1969).

  • 7/27/2019 25906871 Introduction to the Theory of Numbers

    38/312

    2Congruences

    2.1 CongruencesIt is apparent from Chapter 1 that divisibility is a fundamental concept ofnumber theory, one that sets it apart from many other branches of mathematics. In this chapter we continue the study of divisibility, but from aslightly different point of view. A congruence is nothing more than a statement about divisibility. However, it is more than just a convergent notationIt often makes it easier to discover proofs, and we will see that congruencescan suggest new problems that will lead us to new and interesting topics.Definition 2.1 Ifan integer m, not zero, divides the difference a - b, we saythat a is congruent to b modulo m and write a = b (mod m).Ifa-b is notdivisible by m, we say that a is not congruent to b modulo m, and in this casewe write a^b (mod m).

    Since a - b is divisible by m if and only if a - b is divisible by -mwe can generally confine our attention to a positive modulus. Indeed weshall assume throughout the present chapter that the modulus m is a positiveinteger. rCongruences have many properties in common with equalities Someproperties that follow easily from the definition are listed in the followinetheorem. 6

    Theorem 2.1 Let a, b, c, d, x, y denote integers. Then:(a) a = b (mod m), b = a (mod m), and a - b = (mod m) areequivalent statements.

    20

  • 7/27/2019 25906871 Introduction to the Theory of Numbers

    39/312

    2.1 Congruences 21(b) If a = b (mod m) and b = c (mod m), then a = c (mod TW).(c) If a == b (mod w) #/ c == d (mod m), f/ze ## + cy = bx + dy(mod m).(

  • 7/27/2019 25906871 Introduction to the Theory of Numbers

    40/312

    22 Congruences(c) If x = y (mod JH

  • 7/27/2019 25906871 Introduction to the Theory of Numbers

    41/312

    2.1 Congruences 23what amounts to an alternative definition of (m), as given in the followingtheorem.Theorem 2.5 The number (m) is the number ofpositive integers less than orequal to m that are relatively prime to m.Theorem 2.6 Let (a, m) = 1. Let rl9 r2 , * , rn be a complete, or a reduced,residue system modulo m. Then arl9 ar2 , , arn is a complete, or a reduced,residue system, respectively, modulo m.Proof. If (ri9 m) = 1 then (ari9 m) = 1 by Theorem 1.8.

    There are the same number of arl9 ar2 , , arn as of rl9 r2 , , rn .Therefore we need only show that a^ ^ ar^ (mod m) if i ^ j. But Theorem2.3b shows that ari = ar3- (mod m) implies ri = rj (mod m) and hence z =7.Theorem 2.7 Fermat's theorem. Let p denote aprime. Ifp )f a then ).We will postpone the proof of this theorem and will obtain it as a corollary

    to Theorem 2.8.Theorem 2.8 Euler's generalization of Fermafs theorem. If (a, m) = 1 then

    a*(m) as 1 (mod m).Proof. Let r1? r2 , , r^ (m} be a reduced residue system modulo m. Thenby Theorem 2.6, flrl9 0r2 , , flr^ (TO) is also a reduced residue system modulom. Hence corresponding to each ri there is one and only one ar^ such thatri s flry (mod m). Furthermore, different ri will have different correspondingarjt This means that the numbers arl9 ar2 , - , ar^(w) are just the residuesmodulo m of rl9 r%, - - , r^(m) , but not necessarily in the same order.Multiplying and using Theorem 2.ld we obtain

    )-!!^ (modm)A I, J=l i=land hence

    4>(m) (m)aM JJ r . = JJ T} (mod m).j=l j=lNow (r^ m) = 1 so we can use Theorem 2.3b to cancel the rs and we obtain

    a^ (m) ES 1 (mod m).Corollary. Pr00/ o/ Theorem 2.7. If /> ^a then (a,/?) = 1 and a*(p) = 1(mod p). To find ^(/?) we refer to Theorem 2.5. All the integers 1, 2, ,p 1, p with the exception of p are relatively prime to p. Thus we have(p) = p 1 , and the first part of Fermat's theorem follows. The secondpart is now obvious.

  • 7/27/2019 25906871 Introduction to the Theory of Numbers

    42/312

    24 CongruencesCorollary 2.9 If (a, m) = 1 //z

  • 7/27/2019 25906871 Introduction to the Theory of Numbers

    43/312

    2.1 Congruences 25The product on the left has been divided into two parts, each with the samenumber of factors. Pairing offj in the first half withp-jw the second half,we can rewrite the congruence in the form

    (p-D/2II 7*0 -J") s -1 (mod jp).

    Buty(/> -/) EE -/ (mod/?), and so we have, ifp == 1 (mod 4),n -/, , n, . (-

    and so we have a solution, II&1)/27 ? of x2 = -1 (mod/?).If/? ^ 2 and/? =1 (mod 4), then/? = 3 (mod 4). In this case, if for some

    integers, x* == -I (mod/?), then we have a;*-1 == (x*yv-v& == (~ i)to-i)/2 =-.1 (mod /?) since (p - l)/2 == 1 (mod 2). But clearly pjfx, so we have^ x = 1 (mod/?) by Theorem 2.7. This contradiction shows that x2 = -1(mod /?) has no solution in this case.PROBLEMS1. List all integers x in the range 1 ^ x g 100 that satisfy a; = 7 (mod 17).2. Exhibit a complete residue system modulo 17 composed entirely of multiples3. Exhibit a reduced residue system for the modulus 12; for 30.4. If an integer x is even, observe that it must satisfy the congruence x =(mod 2). If an integer y is odd, what congruence does it satisfy? What congruence does an integer z of the form 6k + 1 satisfy?5. Write a single congruence that is equivalent to the pair of congruencesx = 1 (mod 4), x = 2 (mod 3).6. Prove that ifp is a prime and a2 = b2 (mod/?), then/? | (a + 6) or/? | (a - ).7. Show that if f(x) is a polynomial with integral coefficients and if/(a) =k (mod m), thenf(a + tm) = k (mod 777) for every integer t.8. Prove that any number which is a square must have one of the followingfor its units digit: 0, 1, 4, 5, 6, 9.9. Prove that any fourth power must have one of 0, 1, 5, 6 for its units digit.10. Evaluate ^(w) for m = 1, 2, 3, - , 12.11. Find the least positive integer x such that 13 | (x* + 1).12. Prove that 19 is not a divisor of 4n2 + 4 for any integer n.13. Exhibit a reduced residue system modulo 7 composed entirely of powers14. Solve 3x = 5 (mod 11) by the method of Corollary 2.9.15. Illustrate the proof of Theorem 2.10 for /? = 11 and p = 13 by actuallydetermining the pairs of associated integers.

  • 7/27/2019 25906871 Introduction to the Theory of Numbers

    44/312

    26 Congruences16. The integers 12, 23, 34, 45, 56 are congruent to 1 modulo 11. To solve5x ~= 1 (mod 11) we merely note that 45 = 5 9 and hence that x = 9 is asolution. Solve ax == 1 (mod 11) for a = 2, 3, , 10.17. Prove that n* - 1 is divisible by 7 if (72, 7) = 1.18. Prove that n7 - n is divisible by 42, for any integer n.19. Prove that /z12 - 1 is divisible by 7 if (/z, 7) = 1.20. Prove that w6fc - 1 is divisible by 7 if (n, 7) = 1, A: being any positiveinteger.21. Prove that 7z13 - n is divisible by 2, 3, 5, 7, and 13 for any integer n.22. Prove that n12

  • 7/27/2019 25906871 Introduction to the Theory of Numbers

    45/312

    2.2 Solutions of Congruences 2737. If/? is an odd prime, prove that:

    I2 32 - 52 (/? - 2)2 EE (_i)V = ~1 (mod/?).5=1

    40. If rl9 r2 , , r^ and ri, ^2, , r'p are any two complete residue systemsmodulo a prime p > 2, prove that the set r^i, r2/*2, , r^ cannot be acomplete residue system modulo /?.41. If/? is any prime other than 2 or 5, prove that/? divides infinitely many ofthe integers 9, 99, 999, 9999, . Ifp is any prime other than 2 or 5, prove that/? divides infinitely many of the integers 1,11, 111, 1111, .42. If /? is a prime, and if h + k =p 1 with /z ^ and k ^ 0, prove thath\k\ + (~-l)h =0(mod/7).43. For any prime/?, if ap = bp (mod/?), prove that ap = 6P (mod/?2).44. Given an integer n, prove that there is an integer m which to base tencontains only the digits and 1 such that n \ m. Prove that the same holds fordigits and 2, or and 3, , or and 9, but for no other pair of digits.45. If n is composite, prove that (n 1)! + 1 is not a power of n.46. If 1 ^ k < n - 1 prove that (n - I)2 -T (rf - 1).47. If /? is a prime, prove that (/? 1)! + 1 is a power of/? if and only ifp = 2, 3, or 5. Suggestion: if /? > 5, (/? !)! has factors 2, /? 1, and(/? - l)/2, and so (/?-!)! is divisible by (/? - I)2 .48. Prove JJ x = 1 (mod 72) if > 2.

    The symbol on the left denotes the product of all the positive integers x lessthan or equal to n such that both x and x + 1 are relatively prime to TZ.49. Prove that there are infinitely many primes of the form 4/z + 1.50. Prove that (/? - 1)! =/? - 1 (modi + 2 + -+(/?- 1)) if/? is a prime.51. For positive integers let r(/z) denote the number of positive divisors ofn, including n itself. For d such that d \ n, 1 ^ d ^ V , pair flfwith /

  • 7/27/2019 25906871 Introduction to the Theory of Numbers

    46/312

    28 Congruencesf(x) denote a polynomial with integral coefficients, and we will writef(x} = aQxn + a-p 1*1-* + - + an . If u is an integer such that f(u) =(mod m) then we say that u is a solution of the congruence/^) = (mod m).Whether or not an integer is a solution of a congruence depends on themodulus m as well as on the polynomial/^). If the integer u is a solution off(x) = (mod m), and if v = u (mod m), Theorem 2.2 shows that v is also asolution. Because of this we will say that x = u (mod m) is a solution off(x) = (mod m), meaning that every integer congruent to u modulo msatisfies f(x) = (mod m}. For example, the congruence x2 x + 4 =(mod 10) has the solution 3. It also has the solution 8. We can say x =3 (mod 10) and a; = 8 (mod 10) are solutions. In this case, since 8 = 3 (mod 5),we can even say that x = 3 (mod 5) is a solution. In the general case, iff(x) ~ (mod m) has a solution u, it has infinitely many solutions allintegers v such that v = u (mod m). It is more reasonable to count thesolutions in a different way. We will not count v as distinct from u if v =u (mod rri). In the example 3 and 13 are not counted separately. However,3 and 8 are both counted since 3^8 (mod 10).Definition 2.4 Let rl9 r2 , , rm denote a complete residue system modulo m.The number ofsolutions off(x) ~ (mod m) is the number of the ri such thatf(r,) = (mod m).

    It is clear from Theorem 2.2 that the number of solutions is independentof the choice of the complete residue system. Furthermore, the number ofsolutions cannot exceed the modulus m. Ifm is small it is a simple matter tojust compute /(rj for each of the ri and thus to determine the number ofsolutions. In the above example the congruence has just two solutions. Someother examples are

    x2 + I = (mod 7) has no solutions,x2 + 1 = (mod 5) has two solutions,x2 1 = (mod 8) has four solutions.

    Definition 2.5 Letf(x) = a xn + a&^ + - + an . If a* & (mod m) thedegree of the congruencef(x) = (mod m) is n.IfaQ = Q (mod m), let j bethe smallest positive integer such that a3- ^ (mod m); then the degree of thecongruence is n j. If there is no such integer j, that is, if all the coefficientsoff(x) are multiples ofm.no degree is assigned to the congruence.

    It should be noted that the degree of the congruence /(a?) = (mod m) isnot the same thing as the degree of the polynomial /(#). The degree of thecongruence depends on the modulus; the degree of the polynomial does not.Thus if g(x) = 6x* + 3x* + 1, then g(x) = (mod 5) is of degree 3, andg(x) == (mod 2) is of degree 2, whereas g(x) is of degree 3.

  • 7/27/2019 25906871 Introduction to the Theory of Numbers

    47/312

    2.3 Congruences of Degree 1 29Theorem 2.12 If d \ m, d > 0, and if u is a solution off(x) = (mod m),then u is a solution off(x) = (mod d).Proof. This follows directly from Theorem 2.1 e.

    PROBLEMS1. If/(#) = (mod/?) has exactly j solutions with/? a prime, and^Or) =(mod p) has no solutions, prove that f(x)g(x) == (mod p) has exactly jsolutions.2. Denoting the number of solutions of/(x) == k (mod 777) by N(k), prove that

    3. If a congruence/(#) = (mod m) has m solutions, prove that any integerwhatsoever is a solution. (In such a case the congruence is sometimes called anidentical congruence.)4. The fact that the product of any three consecutive integers is divisible by3 leads to the identical congruence x(x + \)(x +2) =0 (mod 3). Generalizethis, and write an identical congruence modulo m.

    2.3 Congruences of Degree 1Any congruence of degree 1 can be put in the form ax = b (mod m), a ^(mod m). From Corollary 2.9 we see that if (a, m) = 1 , then ax ~ b (mod m)

    has exactly one solution, x = x (mod m).Let g denote (a, m). If ax = b (mod m) has a solution u, then b = au

    (mod m) and hence Z? = au = (mod g). Therefore, ax = b (mod m) has nosolution if ^ i. However, if # | b then, for w an integer, au == & (mod m)holds if and only if (a]g)u = (&/#) (mod m/#) by Theorem 2.30. Now(a[g, m/g) 1 and the congruence (a/g)x ~ (&/g) (mod mjg) has just onesolution x = #! (mod m/g-). In other words the solutions of ax = b (mod m)are the integers u such that u = ^ (mod m/g), that is w = a;x + t(mlg) 9t = 0, 1 , 2, . If r is given the values 0, 1 , - , g 1 , then u takes ong values no two of which are congruent modulo m. If t is given any othervalue, the corresponding u will be congruent modulo m to one of these gvalues. Thus the solutions of ax = b (mod m) are x = xl + t(mfg) (mod m),0

  • 7/27/2019 25906871 Introduction to the Theory of Numbers

    48/312

    30 CongruencesFor reasonably small numbers the solution of a congruence can often be

    obtained by inspection or by trying all integers of a complete residue systemmodulo m. However, if the numbers are large the actual numerical solutionof a congruence of the form ax = b (mod m) can be rather lengthy. Thehardest part is solving congruences ax = 1 (mod m) with (a, m) = 1. Thesolution as given in the proof of Corollary 2.9 is not usually very practical.A number of special methods of solution have been developed, but perhapsthe best general method is to use Euclid's algorithm. Using Theorem 1.11 wedetermine g = (a, m) and at the same time obtain integers u and v such thatau + mv = g. Then we can take u for the XQ in Theorem 2.13, and the rest iseasy.Another way to go about solving a congruence of degree 1 is to factor themodulus m XILiX*- Writing mi p%* we note that the mi are relativelyprime in pairs and that [w3 , ra2 , , mk] = m. From Theorem 2.3c we seethat the problem of solving ax = b (mod m) is equivalent to solving the set ofcongruences ax = b (mod ra z-), i = 1, 2, , k, simultaneously. Theindividual congruences ax = b (mod raj may be easier to solve since theirmoduli mi are smaller than m. Suppose the congruences ax = b (mod 777,-) havethe solutions x = ui (mod mt). There still remains the problem of finding thesimultaneous solution x of the set of congruences. The proof of the nexttheorem will show how this can be done.Theorem 2.14 Chinese remainder theorem. Let ml9 m2 , , mr denote rpositive integers that are relatively prime in pairs, and let al9 az , - - - , ar denoteany r integers. Then the congruences x = ai (mod raj, i = 1, 2, , r, havecommon solutions. Any two solutions are congruent modulo m-jn^ mr .Remark. If the moduli ml9 ra2 , , mr are not relatively prime in pairs,there may not be any solution of the congruences. Necessary and sufficientconditions are given in Problem 14(c) in the next problem set.Proof. Writing m = m^m^ - - mr we see that m\m^ is an integer and that(m/mi9 nij) = 1. Therefore, by Corollary 2.9, there are integers bf such that(m/m^bf s= 1 (mod m,). Clearly (m/m^ = (mod m,) if / ^ j. Now if wedefine XQ as

    3=1we have

    2m , __ m0^- = biai = ^ (mod raf)m,- m.3=1so that xQ is a common solution of the original congruences.

  • 7/27/2019 25906871 Introduction to the Theory of Numbers

    49/312

    2.3 Congruences of Degree 1 31If # and x1 are both common solutions of x = a (mod m^, i = 1, 2, , r,

    then xQ = xl (mod m^, for z = 1, 2, , r and hence # = % (mod m) byTheorem 2.3c. This completes the proof.The proof of this theorem provides us with an efficient method for solving

    a certain kind of problem. As an example let us rind all integers that haveremainders 1 or 2 when they are divided by each of 3, 4, and 5. In other wordswe are to find the common solutions of x = 1 or 2 (mod 3), x = 1 or 2(mod 4), x = 1 or 2 (mod 5). We have m^ = 3, m 2 = 4, mz = 5, m = 60,and each ai is 1 or 2. To find b^ we solve (60/3)^ = 1 (mod 3); that is 20^ =1 (mod 3), which is the same as ix = 1 (mod 3). We can take b = 1 andthen have (mlml)bl = 20. Similarly we obtain bz = 1 and (m/m2)b2 =

    15. For Z?3 we have 12 3 = 1 (mod 5), 2Z?3 = 1 , 4Z?3 = 2, 3 = 2, and cantake 3 = 2, (ra/w3) 3 = 24. Using (2.1) we have merely to insert thevalues of the at in x = 20

  • 7/27/2019 25906871 Introduction to the Theory of Numbers

    50/312

    32 Congruences3. Find the smallest positive integer (except x = 1) that satisfies the followingcongruences simultaneously: x = 1 (mod 3), x == 1 (mod 5), x = 1 (mod 7).4. Find all integers that satisfy simultaneously: x == 2 (mod 3), x =3 (mod 5),a? == 5 (mod 2).5. Solve the set of congruences: x = 1 (mod 4), a? z= Q (mod 3), x =5 (mod 7).6. Find all integers that give the remainders 1, 2, 3 when divided by 3, 4, 5respectively,7. If a is selected at random from 1, 2, 3, , 14, and 6 is selected at randomfrom 1 , 2, 3, , 15, what is the probability that ax = b (mod 15) has at leastone solution? Exactly one solution?8. Given any positive integer k, prove that there are k consecutive integers eachdivisible by a square > 1 .9. If x2 is a solution of the congruence ax = b (mod m) (obtained perhaps byapplication of Euclid's algorithm to a and 777), prove that x = x2 + t(mlg)(mod m) gives all solutions as t runs through 0, 1, ,g 1, where g isdefined as^- = (a, m).10. Suppose (a, m) = 1, and let % denote a solution of ax = 1 (mod m). Fors = 1, 2, - , let xs = \\a (1/0)(1 - axj) s . Prove that xs is an integer andthat it is a solution of ax = I (mod ms).11. Suppose that (a, m) = 1. If a = 1, the solution of ax ~ 1 (mod ms) isobviously x = a (mod m s). If a = 2, then 772 is odd and a; = ^(1 - 77zs)Jx = 1 (mod 125) by Problem 11, taking x = 2.13. Let 772l5 w2 , , 77?r be relatively prime in pairs. Assuming that each of thecongruences btx = at (mod 77?f), i = 1, 2, , r, is solvable, prove that thecongruences have a simultaneous solution.14. (a) Consider the set of congruences x = at (mod pe*), i = 1, 2, , r,with e1 ^ e2 = ' ' " = er - Prove that x == at is a simultaneous solution of thesecongruences if /> e * | (a a for i = 2, 3, , r.(b) Let the canonical factoring of TT? be/?^2 . . .^ ft- Prove that any simultaneous solution of the set of congruences x = a (mod /^')> * 1, 2, -,,is a solution of # = ^ (mod 772).(c) Prove that the set of congruences x == ^ (mod 777,-), / = 1, 2, , TZ, has asimultaneous solution if, and only if, (m^ m3) \ (a^ a}) holds for every pairof moduli, that is for every pair of subscripts i,j such that 1 ^ / 0. Prove that there is an integer x such that(a + bx, c) = 1.16. Consider a square divided up into n2 equal squares. Number the columnsof small squares 1, 2, - - , n from left to right. Similarly number the rows1 , 2, , TZ and let {c, r} denote the small square in the cth column and rth row.Let

  • 7/27/2019 25906871 Introduction to the Theory of Numbers

    51/312

    2.3 Congruences of Degree 1 33of the large square, count as if the large square were bent into a cylinder. Thusyou will arrive at {aQ + a, b + b} or {aQ + a - TZ, bQ + b] or {aQ + a, b +b TZ} or {a + a TZ, /3 + Z> #}, whichever is actually one of the smallsquares. Write 2 in this square. Count a to the right and b up

    from 2 and insert3 in the square. Continue until you have written in 1, 2, 3, , n. Prove that772 will have been written in {xm,ym} where xm and ym are uniquely determined by

    - !) (mod ")> 1 ^ ^m ^ n2/m = 6 + K - 1) (mod TZ), 1 ^ 2/m ^ TZ, 1 ^ m ^ TZ.

    Also show that all these squares {xm , ym] are different but that continuingthe process one more step would put n + 1 in {ar , b } which is already occupiedby 1.Now having reached {a , b ] again, count a to the right and p up and writen + 1 in this square which may or may not already be occupied. Then revertto the original process with step a, b to insert n + 2, n + 3, - , 2n. Continuein this manner, using the extra step a, p just for n + l,2n + 1, ,( l)n +1 , and stopping when r? has been inserted.For 1 ^ m ^ n2 prove that ;w is in {#m , 2/m} where

    Fir]#0 +^ - 1) + a (mod/2), 1 ^ Xm g 72,(mod 72), l^ym ^n,[m 1~|J

    \m - 11and is the quotient when TZ is divided into m 1. Also prove that if(a/3 /3a, TZ) = 1 then each square contains one and only one integer T72,1 ^ T72 ^ TZ2 .From now on assume (ap /3a, TZ) = 1. Writing TTZ 1 = ^TZ + s,g s ^ TZ 1 , show that the entries in the cth column are just the m =qn + s + 1 for which ^q :g TZ 1 , = s ^ TZ 1 , and as ^ c aQ aq(mod TZ). Prove that there is one and only one s for each q and that each s isdistinct from all the others. Then show:

    Sum of m in cth column = > TZ + s 4- TZv x^= > ^TZ + / .

  • 7/27/2019 25906871 Introduction to the Theory of Numbers

    52/312

    34 Congruences

    2,4 The Function 4>(n)We will return to the discussion of the solution of congruences in the nextsection. In this section we will use the Chinese remainder theorem to obtainan important property of the function (f>(ri) of Definition 2.3.Theorem 2.15 Let m andn denote any two positive, relatively prime integers.Then c/>(nm) = 1 then (n) = w H^k (1 ~ I/?)- ^^ P#LP'#i ' ' 'Prr) = 1 for 7 = 1, 2, , r - 1. Applying Theorem 2.15repeatedly we obtain

    In order to compute (pe), p a prime, we recall that (pe) is the number ofintegers x such that 1

  • 7/27/2019 25906871 Introduction to the Theory of Numbers

    53/312

    2.4 The Function (n) 351 and/>% and we must count all ofthem except/>, 2p, 3p, j^ 6"1^. Therefore

    and hence

    3=1

    Another way of writing the result of Theorem 2.16 is

    Theorem 2.17 Forn^l we have ^dln (d) = n.Proof. If rc =/?%/? a prime, then

    = 1 + (p - 1) + p(p - 1) + + pe'\p - 1)

    Therefore the theorem is true if n is a power of a prime. Now we proceed byinduction. We suppose the theorem holds for integers with k or fewerdistinct prime factors and consider any integer TV with k + 1 distinct primefactors. Let/? denote one of the prime factors of TV, and let/?6 be the highestpower ofp that divides N. Then N = p en, n has k distinct prime factors, and(/?, TZ) = 1. Now as Granges over the divisors of , the set d,pd,p2d, - - ,pedranges over the divisors of N. Hence we have

    2 #

  • 7/27/2019 25906871 Introduction to the Theory of Numbers

    54/312

    36 Congruences

    PROBLEMS1. For what values of n is (m).7. Show that c/>(nm) = n(m) if every prime that divides n also divides m.8. If P denotes the product of the primes common to m and n 9 prove that(mri) = P(m)(n)l(P). Hence if (m, n) > 1, prove (mri) > (m)(ri).9. If (m) = 1, prove that n 2 and m is odd.10. Characterize the set of positive integers n satisfying (2ri) = (ri).11. Characterize the set of positive integers satisfying (2ri) > 4>(ri).12. Prove that there are infinitely many integers n so that 3 < (n).13. Find all solutions x of (%) = 14, and that 14 isthe least positive even integer with this property. Apart from 14, what is thenext smallest positive even integer n such that ^(x) = n has no solution?17. Prove that for n ^2 the sum of all positive integers less than n and primeto n is /z(/7)/2.18. If n has k distinct odd prime factors, prove that 2k \ (ri).19. Define /(/?) as the sum of the positive integers less than n and prime to n.Prove that/(w) = f(ri) implies that m n.20. Let f (ri) denote the number of integers x such that 1 ^ x ^ n and(x, n) = (x 4- 1 , n) = 1. Prove

    2>|n

    21. (a) Let the canonical factorization of n be n = H*= !/??*'. For eyerypositive integery, define

    4-otherwise.

  • 7/27/2019 25906871 Introduction to the Theory of Numbers

    55/312

    2.5 Congruences of Higher Degree 37Prove that 2?= i ej(pi) = nlpi> and more generally

    'Pi(b) Prove that

    for 1 g r ^ k.

    and hence that #(/i) - J-Li TTLi tt ~(c) Deduce that

    3=1

    and so obtain an independent proof of Theorem 2.16.22. If d n and < d < n, prove that n - (ri) > d - (d).23. Prove the following generalization of Euler's theorem:

    for any integer a.

    2.5 Congruences of Higher DegreeThere is no general method for solving congruences. However, certainreductions can be made so that the problem finally becomes that of solvingcongruences with prime moduli. We can use the method of the Chineseremainder theorem in the first step of this reduction.If m = pllp ecf - p*r then the congruence /(x) = (mod m) is equivalentto the set of congruences /(#) = (mod /?/), f = 1, 2, , r, in the sensethat solutions of one are solutions of the other. If for some 7, 1 ^j^r, thecongruence/(a;) = (modp**) has no solution, then /(a) = (mod m) hasno solution. On the other hand, if all the congruences/^) = (mod/?^) havesolutions, we can suppose that the zth congruence has exactly ki solutions,say a (^\af\ , afl\ No two of these are congruent modulo p*, byDefinition 2.4, and every solution of/(x) = (modpl 1) is congruent to somea (i 3) modulo^-.Now an integer u is a root off(x) = (mod m) if and only if for each zthere is ay'f such that u = a^^ (modp^). Since the moduli p\l are relativelyprime in pairs, the Chinese remainder theorem is applicable. We determineintegers &z- such that mp^ eibi = 1 (mod p?*) and can then find u by means

  • 7/27/2019 25906871 Introduction to the Theory of Numbers

    56/312

    38 Congruencesof (2.1):

    r -^(2.2) u = ^

    ~ b*ai*i} (mod )'When actually solving a problem it is usually best to compute the coefficientsmp^ &ib i first since they are independent of the choice of the/,-. It is then easyto insert the various values of the a- Ji) in (2.2), and the problem is solved.There will be a different u modulo m for each choice of the integers

    J\9J29 ' * " >Jr> anc* each 7;. can take on any of ki values. Therefore the congruence/^) = (mod m) has kjk^ - kr solutions. Since kt is the number ofsolutions of/(a?) = (mod />**)> we have the following theorem.Theorem 2.18 Let N(m) denote the number of solutions of the congruence(x) = (mod m). Then N(m) = II

  • 7/27/2019 25906871 Introduction to the Theory of Numbers

    57/312

    2.6 Prime Power Moduli 392. Solve the congruence x2 + 4x + 8 = (mod 15).3. Solve the congruence x3 9x2 + 23x 15^0 (mod 503) by observingthat 503 is a prime and that the polynomial factors into (x \)(x 3)(x 5).4. Solve the congruence x3 - 9x2 + 23x - 15 = (mod 143).2.6 Prime Power Moduli

    The problem of solving a congruence has now been reduced to that'of solvinga congruence whose modulus is a power of a single prime.

    If r is a solution of /(a?) = (mod /), then/(r) =~ (mod /) for t =1, 2, ,s. Let z' 1 ', x (*\ , o^ be the solutions of /(a) = (mod /).There may be no such solutions, or there may be many. Consider

    s ^ 2. Ifthere is a solution x then there is a solution^ of/(z) = (mod /7s"1) suchthatrcj = ^1 (modp8-1). Therefore o?^ = rr^i + v^p*-1 (mod/) for someinteger v^.Remembering that/(x) is a polynomial of degree n with integral coefficients,

    we see that f'(x) 9 f(x) 9 - - - are polynomials with integral coefficientsand that/ u) (o;) is identically zero for t > n. Thus the Taylor's expansion off(x) is finite and we have

    f(x + h) =f(x) +f(x)h + -2 f"(x)h* + - - + ^f(n\*W,and then

    EE f(x) = f(xll + vs_lPs-1) = /(a;^) + /'(x^Dv^p-1 (mod ps).But/(o?iffl) == (mod^5-1) so we have

    (2.3) /'(^)^ = - -/(i)Conversely, if

    (2.4) /'(e> s - -^/(^-i) (mod p),s-i + i/'1) = (mod/). This shows us how to find all the solutionsoff(x) = (mod/), s ^ 2, if we know those off(x) = (mod/*1). For

    each root x^ we find all the solutions v of (2.4), and then the integersx ( i + i/""1 will be solutions off(x) = (mod /). It can, of course, happenthat there are no v corresponding to some x }8_i. In this case we have nosolutions off(x) = (mod/?5) arising from this particular ^i\.

  • 7/27/2019 25906871 Introduction to the Theory of Numbers

    58/312

    40 CongruencesWe can say a little more about the solutions. In solving/(#) = (modp8),

    $*z2, we start with the solutions x[3} off(x) = (mod /?). Fixing upon aparticular x[ 3^ we must first solve (2.3), with s = 2, for v: . For each v 1 wehave a root 4fc) = a4' ) + v^p (mod/? 2) off(x) = (mod/?2). Using each oneof these 4fc) we must then solve (2.3) with s = 3,jt = k, in order to findsolutions of/(x) = (mod/?3). But the congruence for i?2 has modulus/? and4fc> = x[3 * } (mod/?), and hence we can write it as

    jf'(xi)vz f(xzj (mod p).PThis happens at each stage, and hence we may determine t?^ from(2.5) /'(^K-i = - ;r~ /(^-i) (md P)for all the a;^ that ultimately arose from the solution x[** } off(x) = (mod/?).The congruence (2.5) is a linear congruence. Iff'fai 3 *) 7^ (mod/?), thenthere will be exactly one vs_: for each of the 0^1 arising ultimately from x[Ji\Iff'tyi**) = (mod/?), then there will be/? or no t?^ according as/^^)//?^1is or is not congruent to modulo p.Example. Solve x2 + x + 7 = (mod 27).By trial we find that x == 1 (mod 3) is the only solution off(x) = (mod 3) for

    the present/^). Then/'(oO = 2x + 1 and/'(l) == (mod 3). There is only one xl9and (2.5) reduces to

    which means that there are no v^ if/(^) ^ (mod 3 s) and that vs_^ = 0, 1,-1 (mod 3) if/(a^i) = (mod 3 s). We now find41} = 1 (mod 3),f(41]) =9, ^ = 0, 1, -1 (mod 3)41} = 1 (mod 32),/(41)) = 9, no z;242) = 4 (mod 32),/(42)) = 27, z;2 = 0, 1, -1 (mod 3)^ 23) s -2 (mod 32),/(43)) = 9, no i?24X) = 4 (mod 33)42) = 13 (mod 33)43) s _5 (mod 33^

    Example. Solve x* + # + 7 = (mod 34).Continuing from the previous example, we find

    /(4X)) = 27, /(42)) = 189, /(43>) = 27.The congruence has no solution since 27 ^ 0, 189 & (mod 34).

  • 7/27/2019 25906871 Introduction to the Theory of Numbers

    59/312

    2.6 Prime Power Moduli 41Example. Solve oc2 + x + 1 == (mod 73).The solutions of f(x) =0 (mod 7) are x == 0, 1 (mod 7). Furthermore,

    /'(O) = !,/'(-!) = -1. There will be just one 41} corresponding to a?f = Oandone 42) corresponding to 42) = 1. Now (2.5) becomesus_! = - ^/(4-i) (mod 7) corresponding to 41} =ys_i ss zi/(4-i) (mod 7) corresponding to 42) = -1-

    Then we find4*> = 0, /(4) - 7, !>! = -!, 41} = -7, /a = -1, 4 = -56,42) = -1, /(42)) =7, ^ = 1, 42) = 6, /(42)) = 49,v2 = l, 42) =55.

    The solutions of cc2 4- a? + 7 = (mod 73) are x = -56 (mod 73) and x = 55(mod 73).When solving numerical problems one often must determine whether or

    not one integer k divides another integer n. If (k, 10) = 1 and k is not toolarge, there is a rather simple way to do this. As a first example considerk = 31 , it = 23754. Then n - 4k = 23754 - 4 30 - 4 = 10(2375 -4-3)= 10-2363. Since (31, 10) = 1 we see that 31 | 23754 if and only if31

    |2363. We can repeat the argument to reduce 2363 still further. The entire

    process can be put in a more convenient form.23754

    122363

    9227"21T 31 1 23754.

    This process can be used for any k whose last digit is 1 . We can write k =10/ + 1 and n = Wa + b. Then n - bk = 10a + b - IQbj - b = 10(0 -bj), and k \ n if and only if k \ (a bj).

    If the last digit of k is 9, we can write k = 1Q/ 1 and n = 100 + b, andwe have n + bk = 10a + b + IQbj - b = 10(0 + bj). Then k \ n if and onlyif k

    \ (a + bj). If the last digit of k is 3, we can write 3k = 10; - 1 and findn 4. ibk = 10(0 + /), and hence k\nit and only if fc | (0 + */) Similarly,if the last digit of A: is 7, we write 3k = Wj + 1 and obtain k \ n if and only ifk\(a- bj).

  • 7/27/2019 25906871 Introduction to the Theory of Numbers

    60/312

    42 CongruencesExample. 19 = 10 2 - 1 3 7 = 10 2 + 1

    20513 86386 _16

    2057 847J4 14219 70183919^20513 7 | 8638

    PROBLEMS1. The foregoing method determines whether k divides , but in general thenumber we finally reach is not congruent to n modulo k. Consider the followingscheme, exemplified for n = 1234.

    1234369108

    309

    Here we have written down 1234, then 3 123, 3 36, 3 10, 3 3, in turn. Wedrop oif the right digit at each step and multiply what is left by 3. Now we haven = 1234 =4+9+8+0+9= 30 = 2 (mod 7) and also n = 1234 =4 -9+8 0+9 = 12 (mod 13). Show why this works for all positive integersn. What multiplier should be used instead of 3 if the modulus k is 9 or 1 1 ; ifk = 17; if A: = 19? For k = 17 and 19 the procedure is likely to be too longto be of any practical value. Find more satisfactory variations of the method.For example: 1734562867254335215

    101734562 s 62 + 25 + 35 + 15 + 10 = 147 E= 47 + 5 s 52 = 14 (mod 19).2. Show that for k = 9 the method in the text and the method of problem 1are essentially the same and that they amount to the familiar process of"casting out nines."3. Using the fact that 1001 =7-11-13, and assuming that you can recognizeall multiples of 7 or 11 or 13 having no more than three digits, work out ascheme for testing for divisibility by 7 or 11 or 13 simultaneously.4. Prove (y + vp*-1)' = y* +

  • 7/27/2019 25906871 Introduction to the Theory of Numbers

    61/312

    2.7 Prime Modulus 43Prove

    n-If(y + vp*-1) -/(#) =^ (n - i)aP~ i~'lvp*~'1 (mod/>s) if s ^ 2

    and

    This can be used to replace the use of Taylor's expansion at the beginningof this section.5. Apply the method of this section to solve ax 1 = (modp s), (a,p) = 1.How are these solutions related to those given by Problem 1 1 of section 2.3with m replaced byp s ?6. Solve x5 + #4 + 1 ==0 (mod 34).7. Solve a3 + x + 57 = (mod 53).8. Solve #2 + 5z + 24 s (mod 36).9. Solve xz + 10z2 + x + 3 = (mod 33).10. Solve x* + x2 - 4 EE (mod 73).11. Solve x* + a2 - 5 = (mod 73).

    2.7 Prime ModulusWe have now reduced the problem of solving f(x) = (mod ra) to its laststage, congruences with prime moduli. It is here that we will not be able tofind a general method. However, there are some general facts concerningthe solutions, and we will find that we are led to some new and interestingmatters.As before, we write/(oj) = aQxn + a^^ + + an and we assume that

    p is a prime and aQ = (mod/>).Theorem 2.19 If the degree n off(x) = (mod p) is greater than or equalto p, then either every integer is a solution off(x) = (mod p) or there is apolynomial g(x) having integral coefficients, with leading coefficient 1, and suchthat g(x) = (mod p) is of degree less that p and the solutions of g(x) =(modp) are precisely those off(x) = (modp).

    Proof. Dividing f(x) by x* - x we obtain f(x) = q(x)(x*> - x) + r(x)where q(x) is a polynomial with integral coefficients and r(x) is either zero or apolynomial with integral coefficients and degree less than/?. Fermat's theoremshows that u* u ss (mod p), and hence f(u) EE r(u] (mod p) for everyinteger u. Therefore if r(x) is zero, or if every coefficient in r(x) is divisibleby/?, then every integer is a solution of/(z) == (mod/?). The only otherpossibility is r(x) = bmxm + bm_^xm^ + \-b^m

  • 7/27/2019 25906871 Introduction to the Theory of Numbers

    62/312

    44 Congruencescoefficient not divisible by p. Let bk be the coefficient with largest subscriptk such that (/?, bk) = 1. Then there is an integer b such that bbk == 1 (mod/?),and clearly r(x) = (mod/?) and br(x) = (mod /?) have the same solutions.The requirements of the theorem are satisfied if we define g(x) as

    In the statement of Theorem 2.19, g(x) is described as having the propertythatg(o;) == (mod/?) and f(x) = (mod/?) have the same solutions. Fromthe proof of the theorem we see that g(u) = bf(u) (mod/?) for every integer u.However, we do not say that the polynomials g(x) and bf(x) are congruentmodulo p ; we will use this last statement to mean that each coefficient in g(x)is congruent modulo p to the corresponding coefficient in bf(x).Theorem 2.20 The congruence f(x) = (mod p) of degree n has at most nsolutions.

    Proof. The proof is by induction on the degree of f(x) = (mod p). In = 0, the polynomial /(#) is just a with a ^ (mod p), and hence thecongruence has no solution. If n = 1, the congruence has exactly onesolution by Theorem 2.13. Assuming the truth of the theorem for all congruences of degree

  • 7/27/2019 25906871 Introduction to the Theory of Numbers

    63/312

    2.7 Prime Modulus 45Theorem 2.22 The congruence f(x) = (mod p) of degree n, with leadingcoefficient a = 1, has n solutions if and only iff(x) is a factor of xp xmodulo p, that is, ifand only ifxp x = f(x)q(x) + ps(x) where q(x) ands(x)have integral coefficients, and where either s(x) is a polynomial of degree lessthan n or s(x) is zero.Proof. If/(#) = (mod/?) has n solutions, then n^.p. Dividing x* x byf(x), we find xp x = f(x)q(x) + r(x) where r(x) is zero or r(x) has degreeless than n. For every solution u off(x) = (mod p) we have up u =(mod /?), and hence r(u) = (mod p). Therefore if r(x) is not zero, it is apolynomial of degree less than n having n solutions. According to Corollary2.21 all the coefficients of r(x) are divisible byp, and we can write r(x) ~ ps(x).

    Conversely, if x* x = f(x)q(x) + ps(x) 9 then f(u)q(u) == u* ups(u) == (mod/?) for every integer u. Thereforef(x)q(x) = (mod/?) hasj?solutions. But q(x) is of degree p-n with leading coefficient 1 , and hence byTheorem 2.20 the congruence q(x) = (mod p) has at most p-n solutions,t?i, Vt,- 9 vk , say, with k ^p-n. If u is any of the other p-k residuesmodulo p, then (q(u),pj) = 1 and f(u)q(u) == (mod p), and we havef(u) = (mod p) by Theorem 1.15. Hence f(x) = (mod p) has at leastp k^p (p n) = n solutions. This, with Theorem 2.20, shows thatf(x)

    = (mod p) has exactly n solutions.The restriction a = 1 in this theorem is needed so that we may dividexp x by/(a) and obtain a polynomial q(x) with integral coefficients. However, it is not very much of a restriction. We can always find an integer a suchthat aa = 1 (mod/?). Then af(x) (aaQ l)xn == (mod/?) has the samesolutions as f(x) == (mod /?), and af(x) (aa l)xn has its leadingcoefficient 1.

    PROBLEMS1. Reduce the following congruences to equivalent congruences of degree ^ 6:(a) z11 +x* +5 =0(mod7);(b) a:20 + rr13 + x7 + a; = 2 (mod 7);(c) a;15 - a10 + 4a - 3 = (mod 7).2. Prove that 2a;3 + 5ic2 + 6x + 1 =0 (mod 7) has three solutions by use ofTheorem 2.22.3. Prove that #14 + 12#2 = (mod 13) has thirteen solutions and so it is anidentical congruence.4. Prove that iff(x) = (mod p) has j solutions x == alt x = 2 , , x =as (mod p), there is a polynomial q(x) such that /(a?) = (x - ^(a? - a2). . . (^ _ ^5-)?(^) (mod /?). Suggestion: begin by showing that there is a ^(z)suchthat/(tf) s (a? - ajq^x) (mod/?) and that^(a) = (mod/?) has solutionsx = a^ x = 3 , , x = dj (mod/?). Then use induction.

  • 7/27/2019 25906871 Introduction to the Theory of Numbers

    64/312

    46 Congruences5. With the assumptions and notation of the previous problem, prove that ifthe degree off(x) is j, then q(x) is a constant and can be taken as the leadingcoefficient of/(#).6. Prove that Fermat's theorem implies that

    xv-i - i = (p _ \)(X - 2) (a? -p + 1) (mod;?)and

    xp x = x(x \)(x - 2) - (x p + 1) (mod/?).7. By comparing coefficients of x in the previous problem, give another proofof Wilson's theorem.8. Let m be composite. Prove that Theorem 2.20 is false if "mod/' is replacedby "mod m."

    2.8 Congruences of Degree Two, Prime ModulusIff(x) = (mod /?) is of degree two, then /(a) = ax2 + bx + c, and a isrelatively prime to p. We will suppose p>2 since the case/? = 2 offers nodifficulties. Then p is odd, and 4af(x) = (lax + b}2 + 4ac b2 . Hence uis a solution off(x) = (mod p) if and only if 2au + b = v (mod/), wherez; is a solution oft; 2 == b 2 4#c (mod/). Furthermore, since (20,/>) = 1, foreach solution v there is one, and only one, u modulo p such that 2au + b =v (mod/). Clearly different v modulo/? yield different u modulo p. Thus theproblem of solving the congruence of degree two is reduced to that of solvinga congruence of the form x2 = a (mod p).

    In Chapter 3 we will consider the congruence x2 = a (mod/) in detail. Forthe present we will merely obtain some general results concerning the moregeneral congruence xn = a (mod p) and certain related concepts.

    PROBLEM1. Reduce the following congruences to the form x2 = a (mod/?):(a) 4x* + 2x + 1 == (mod 5); (b) 3x* - x + 5 = (mod 7);(c) 2x* + 7x - 10 s (mod 11); (

  • 7/27/2019 25906871 Introduction to the Theory of Numbers

    65/312

    2.9 Power Residues 47Since a*(m} == 1 (mod m) by Euler's theorem, we see that every a relatively

    prime to m belongs to some exponent A ^ (rri) modulo m. Dividing (m)by A we obtain (m) = qh + /*, ^ r < A. But then ar = ar+** = 0*(m) s= 1(mod m). Since A is the least positive integer such that an = 1 (mod m), andsince ^ r < A, we see that r cannot be positive. Therefore r = 0, and wehave the first assertion in the following theorem.Theorem 2.23 If a belongs to the exponent h modulo m then h \ (rri).Furthermore aj = ak (mod m) ifand only ifh \ (j k).Proof. There is no loss in generality in assuming j > k 9 and since (a, m) = 1 ,the congruence aj = ak (mod m) is equivalent to a^~k = 1 (mod m). Thus thesecond assertion in the theorem follows as in the proof of the first assertion.Theorem 2.24 Ifa belongs to the exponent h modulo m then ak belongs to theexponent A/ (A, k] modulo m.Proof. According to Theorem 2.23, (aky = 1 (mod m) if and only if A | kj.But A

    |kj if and only if {A/(A, k)} \ {fc/(A, k)}j and hence if and only if

    {A/(A, k)} \j. Therefore the least positive integer./ such that (dy = 1 (mod m)Definition 2.8 If a belongs to the exponent (m) modulo m, then a is calleda primitive root modulo m.Theorem 2.25 If p is a prime, then there exist (p 1) primitive rootsmodulo p. The only integers having primitive roots arep e , 2pe , 1 , 2, and 4, withp an odd prime.Proof. Each integer a, l

  • 7/27/2019 25906871 Introduction to the Theory of Numbers

    66/312

    48 Congruenceshave a* (^ = 1 (mod /*) and a* (ml*^= I (mod mjp$). Suppose thatk ^2 or/ ^2. Then both (p{1) and ^(m//1) are even, and thereforea4*

  • 7/27/2019 25906871 Introduction to the Theory of Numbers

    67/312

    2.9 Power Residues 49Proof. The first part of the theorem is a spe