http://dx.doi.org/10.1090/stml/045 This page intentionally left blank Higher Arithmeti c An Algorithmic Introduction to Number Theory STUDENT MATHEMATICAL LIBRARY Volume 45 Higher Arithmeti c An Algorithmic Introduction to Number Theory Harold M. Edwards ilAMS AMERICAN MATHEMATICAL SOCIETY Providence, Rhode Island Editorial Boar d Gerald B. Folland Bra d G. Osgood (Chair ) Robin Forman Michae l Starbir d 2000 Mathematics Subject Classification. Primar y 11-01 . For additional information an d updates on this book, visi t www.ams.org/bookpages/stml-45 Library of Congress Cataloging-in-Publicatio n Dat a Edwards, Harold M. Higher arithmetic : an algorithmic introduction to number theory / Harold M. Edwards. p. cm. — (Student mathematical library, ISSN 1520-9121 ; v. 45) Includes bibliographical references and index. ISBN 978-0-8218-4439-7 (alk. paper) 1. Number theory. I . Title. QA241 .E39 200 8 512.7—dc22 200706057 8 Copying and reprinting. Individua l readers of this publication, and nonprofi t libraries acting for them, are permitted to make fair use of the material, such as to copy a chapter for use in teaching or research. Permissio n is granted to quote brief passages from this publication in reviews, provided the customary acknowledgment of the source is given. Republication, systematic copying, or multiple reproduction of any material in this publication is permitted only under license from the American Mathematical Society. Requests for such permission should be addressed to the Acquisitions Department , American Mathematical Society, 201 Charles Street, Providence, Rhode Island 02904- 2294, USA. Requests can also be made by e-mail to [email protected]. © 200 8 by the American Mathematical Society. All rights reserved. The American Mathematical Society retains all rights except those granted to the United States Government . Printed in the United States of America. @ Th e paper used in this book is acid-free and falls within the guidelines established to ensure permanence and durability. Visit the AMS home page at http://www.ams.org / 10 9 8 7 6 5 4 3 2 1 1 3 12 11 10 09 08 Contents Preface i x Chapter 1. Number s 1 Chapter 2. Th e Problem AD + B = • 7 Chapter 3. Congruence s 1 1 Chapter 4. Doubl e Congruences and the Euclidean Algorithm 1 7 Chapter 5. Th e Augmented Euclidean Algorithm 2 3 Chapter 6. Simultaneou s Congruences 2 9 Chapter 7. Th e Fundamental Theorem of Arithmetic 3 3 Chapter 8. Exponentiatio n and Orders 3 7 Chapter 9. Euler' s </>-Function 4 3 Chapter 10. Findin g the Order of a mod c 4 5 Chapter 11. Primalit y Testing 5 1 VI Higher Arithmeti c Chapter 12. The RSA Cipher System 57 Chapter 13. Primitive Roots mod p 61 Chapter 14. Polynomials 67 Chapter 15. Tables of Indices mod p 71 Chapter 16. Brahmagupta's Formula and Hypernumbers 77 Chapter 17. Modules of Hypernumbers 81 Chapter 18. A Canonical Form for Modules of Hypernumbers 87 Chapter 19. Solution of AD + B = • 93 Chapter 20. Proof of the Theorem of Chapter 19 99 Chapter 21. Euler's Remarkable Discovery 113 Chapter 22. Stable Modules 119 Chapter 23. Equivalence of Modules 123 Chapter 24. Signatures of Equivalence Classes 129 Chapter 25. The Main Theorem 135 Chapter 26. Modules That Become Principal When Squared 137 Chapter 27. The Possible Signatures for Certain Values of A 143 Chapter 28. The Law of Quadratic Reciprocity 149 Chapter 29. Proof of the Main Theorem 153 Chapter 30. The Theory of Binary Quadratic Forms 155 Chapter 31. Composition of Binary Quadratic Forms 163 Contents vn Appendix. Cycle s of Stable Modules 16 9 Answers to Exercises 17 9 Bibliography 20 7 Index 20 9 This page intentionally left blank Preface It is widely agreed that Car l Friedrich Gauss's 1801 book Disquisi- tiones Arithmeticae [G ] was the beginning of modern number theory, the first wor k on the subject tha t wa s systematic an d comprehen - sive rather than a collection of special problems and techniques. Th e name "numbe r theory" by which the subject is known today was in use at the time—Gauss himself used it (theoria numerorum) i n Arti- cle 56 of the book—but h e chose to call it "arithmetic " in his title. He explained i n the first paragraph o f his Preface tha t h e did no t mean arithmetic in the sense of everyday computations with whole numbers but a "highe r arithmetic" tha t comprise d "genera l studies of specific relations among whole numbers." I too prefer "arithmetic" to "number theory." T o me, number the- ory sounds passive, theoretical, and disconnected from reality. Higher arithmetic sounds active, challenging, and related to everyday reality while aspiring to transcend it. Although Gauss's explanation of what he means by "higher arith- metic" in his Preface is unclear, a strong indication of what he had in mind comes at the end of his Preface when he mentions the material in his Section 7 on the construction o f regular polygons. (I n mod - ern terms, Sectio n 7 is the Galois theory of the algebraic equatio n xn — 1 = 0.) H e admits that this material does not truly belong to arithmetic but that "it s principles must be drawn from arithmetic. " IX