0% found this document useful (0 votes)
291 views

Rosen - Elementary Number Theory and Its Applications

Uploaded by

Marcelo Lima
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
291 views

Rosen - Elementary Number Theory and Its Applications

Uploaded by

Marcelo Lima
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 462
Elementary Number Theory and Its Applications Kenneth H. Rosen AT&T Information Systems Laboratories Gormerly part of Bell Laboratories) Ad ADDISON-WESLEY PUBLISHING COMPANY Reading, Massachusetts Menlo Park, California London + Amsterdam Don Mills, Ontario « Sydney Cover: The iteration of the transformation n/2— if-niseven T= Yon via itn vot is depicted. The Collatz conjecture asserts that with any. starting point, the iteration of Teventually reaches the integer one. (See Problem 33 of Section 1.2 of the text.) Library of Congress Cataloging in Publication Data Rosen, Kenneth H. Elementary number theory and its applications. Bibliography: p. Includes index, 1, Numbers, Theory of. 1, Title. QA241.R67 1984 512.72 83-1804 ISBN 0-201-06561-4 Reprinted with corrections, June 1986 Copyright © 1984 by Bell Telephone Laboratories and. Kenneth H. Rosen. All rights reserved. No part of this publication may be reproduced, stored ina retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without rior written permission of the publisher. Printed in the United States of America. Published simultaneously in Canada. DEFGHIJ—MA—8987. Preface Number theory has long been a favorite subject for students and teachers of mathematics. It is a classical subject and has a reputation for being the “purest” part of mathematics, yet recent developments in cryptology and computer science are based on elementary number theory. This book is the first text to integrate these important applications of elementary number theory with the traditional topics covered in an introductory number theory course. This book is suitable as a text in an undergraduate number theory course at any level. There are no formal prerequisites needed for most of the material covered, so that even a bright high-school student could use this book. Also, this book is designed to be a useful supplementary book for computer science courses, and as a number theory primer for computer scientists interested in learning about the new developments in cryptography. Some of the important topics that will interest both mathematics and computer science students are recursion, algorithms and their computational complexity, computer arithmetic with large integers, binary and hexadecimal representations of integers, primality testing, pseudoprimality, pseudo-random numbers, hashing functions, and cryptology, including the recently-invented area of public-key cryptography. Throughout the book various algorithms and their computational complexities are discussed. A wide variety of primality tests are developed in the text. Use of the Book The core material for a course in number theory is presented in Chapters 1, 2, and 5, and in Sections 3.1-3.3 and 6.1. Section 3.4 contains some linear algebra; this section is necessary background for Section 7.2; these two sections can be omitted if desired. Sections 4.1, 4.2, and 4.3 present traditional applications of number theory and Section 4.4 presents an application to computer science; the instructor can decide which of these sections to cover. Sections 6.2 and 6.3 discuss arithmetic functions, Mersenne primes, and perfect numbers; some of this material is used in Chapter 8 Chapter 7 covers the applications of number theory to cryptology. Sections 7.1, 7.3, and 7.4, which contain discussions of classical and public-key v vl Preface cryptography, should be included in all courses. Chapter 8 deals with primitive roots; Sections 8.1-8.4 should be covered if possible. Most instructors will want to include Section 8.7 which deals with pseudo-random numbers. Sections 9.1 and 9.2 are about quadratic residues and reciprocity, a fundamental topic which should be covered if possible; Sections 9.3 and 9.4 deal with Jacobi symbols and Euler pseudoprimes and should interest most readers. Section 10.1, which covers rational numbers and decimal fractions, and Sections 11.1 and 11.2 which discuss Pythagorean triples and Fermat's last theorem are covered in most number theory courses. Sections 10.2-10.4 and 11.3 involve continued fractions; these sections are optional. ‘The Contents The reader can determine which chapters to study based on the following description of their contents. Chapter 1 introduces two importants tools in establishing results about the integers, the well-ordering property and the principle of mathematical induction. Recursive definitions and the binomial theorem are also developed. The concept of divisibility of integers is introduced. Representations of integers to different bases are described, as are algorithms for arithmetic operations with integers and their computational complexity (using big-O notation). Finally, prime numbers, their distribution, and conjectures about primes are discussed. Chapter 2 introduces the greatest common divisor of a set of integers. The Euclidean algorithm, used to find greatest common divisors, and its computational complexity, are discussed, as are algorithms to express the greatest common divisor as a linear combination of the integers involved. The Fibonacci numbers are introduced. Prime-factorizations, the fundamental theorem of arithmetic, and factorization techniques are covered. Finally, linear diophantine equations are discussed. Chapter 3 introduces congruences and develops their fundamental properties. Linear congruences in one unknown are discussed, as are systems of linear congruences in one or more unknown. The Chinese remainder theorem is developed, and its application to computer arithmetic with large integers is described. Chapter 4 develops applications of congruences. In particular, divisibility tests, the perpetual calendar which provides the day of the week of any date, round-robin tournaments, and computer hashing functions for data storage are discussed. Preface vii Chapter 5 develops Fermat's little theorem and Euler's theorem which give some important congruences involving powers of integers. Also, Wilson's theorem which gives a congruence for factorials is discussed. Primality and probabilistic primality tests based on these results are developed. Pseudoprimes, strong pseudoprimes, and Carmichael numbers which masquarade as primes are introduced. Chapter 6 is concerned with multiplicative functions and their properties Special emphasis is devoted to the Euler phi-function, the sum of the divisors function, and the number of divisors function and explicit formulae are developed for these functions. Mersenne primes and perfect numbers are discussed. Chapter 7 gives a thorough discussion of applications of number theory to cryptology, starting with classical cryptology. Character ciphers based on modular arithmetic are described, as is cryptanalysis of these ciphers. Block ciphers based on modular arithmetic are also discussed. Exponentiation ciphers and their applications are described, including an application to electronic poker. The concept of a public-key cipher system is introduced and the RSA cipher is described in detail. Knapsack ciphers are discussed, as are applications of cryptography to computer science. Chapter 8 includes discussions of the order of an integer and of primitive roots. Indices, which are similar to logarithms, are introduced. Primality testing based on primitive roots is described. The minimal universal exponent is studied. Pseudo-random numbers and means for generating them are discussed. An application to the splicing of telephone cables is also given. Chapter 9 covers quadratic residues and the famous law of quadratic reciprocity. The Legendre and Jacobi symbols are introduced and algorithms for evaluating them are developed. Euler pseudoprimes and a probabilistic primality test are covered. An algorithm for electronically flipping coins is developed Chapter 10 covers rational and irrational numbers, decimal representations of real numbers, and finite simple continued fractions of rational and irrational numbers. Special attention is paid to the continued fractions of the square roots of positive integers. Chapter 11 treats some nonlinear diophantine equations. Pythagorean triples are described. Fermat's last theorem is discussed. Finally, Pell’s equation is covered. viii Preface Problem Sets After each section of the text there is a problem set containing exercises of various levels of difficulty. Each set contains problems of a numerical nature; these should be done to develop computational skills. The more theoretical and challenging problems should be done by students after they have mastered the computational skills. There are many more problems in the text than can be realistically done ina course, Answers are provided at the end of the book for selected exercises, mostly those having numerical answers. Computer Projects After each section of the text there is a selection of computer projects that involve concepts or algorithms discussed in that section. Students can write their programs in any computer language they choose, using a home or personal computer, or a minicomputer or mainframe. 1 encourage students to use a structured programming language such as C, PASCAL, or PL/I, to do these projects. The projects can serve as good ways to motivate a student to Tearn a new computer language, and can give those students with strong computer science backgrounds interesting projects to tie together computer science and mathematics. Unsolved Problems In the text and in the problem sets unsolved questions in number theory are mentioned. Most of these problems have eluded solution for centuries. The reader is welcome to work on these questions, but should be forewarned that attempts to settle such problems are often time-consuming and futile. Often people think they have solved such problems, only to discover some subtle flaw in their reasoning, Bibliography At the end of the text there is an extensive bibliography, split imto a section for books and one for articles. Further, each section of the bibliography is subdivided by subject area. In the book section there are lists of number theory texts and references, books which attempt to tie together computer science and number theory, books on some of the aspects of computer science dealt with in the text, such as computer arithmetic and computer algorithms, books on cryptography, and general references. In the articles section of the bibliography, there are lists of pertinent expository and research papers in number theory and in cryptography. These articles should be of interest to the reader who would like to read the original sources of the material and who wants more details about some of the topics covered in the book. Preface ix ‘Appendix A set of five tables is included in the appendix to help students with their computations and experimentation. Students may want to compile tables different than those found in the text and in the appendix; compiling such tables would provide additional computer projects. List of Symbols A list of the symbols used in the text and where they are defined is included. Acknowledgments I would like to thank Bell Laboratories and AT&T Information Systems Laboratories for their support for this project, and for the opportunity to use the UNIX system for text preparation. I would like to thank George Piranian for helping me develop a lasting interest in mathematics and number theory. Also I would like to thank Harold Stark for his encouragement and help, starting with his role as my thesis advisor. The students in my number theory courses at the University of Maine have helped with this project, especially Jason Goodfriend, John Blanchard, and John Chester. I am grateful to the various mathematicians who have read and reviewed the book, including Ron Evans, Bob Gold, Jeff Lagarias and Tom Shemanske. [ thank Andrew Odlyzko for his suggestions, Adrian Kester for his assistance in using the UNIX system for computations, Jim Ackermann for his valuable comments, and Marlene Rosen for her editing help. 1 am particularly grateful to the staff of the Bell Laboratories/American Bell/AT&T Information Services Word Processing Center for their excellent work and patience with this project. Special thanks go to Marge Paradis for her help in coordinating the project, and to Diane Stevens, Margaret Reynolds, Dot Swartz, and Bridgette Smith. Also, I wish to express my thanks to Caroline Kennedy and Robin Parson who typed preliminary versions of this book at the University of Maine. Finally, | would like to thank the staff of Addison-Wesley for their help. I offer special thanks to my editor, Wayne Yuhasz, for his encouragement, aid, and enthusiasm. Lincroft, New Jersey Kenneth H. Rosen December, 1983 Contents Chapter 1. Chapter 2, 21 2.2 23 24 25 Chapter 3. 3a 3.2 33 34 Chapter 4. 41 42 43 44 Introduction ‘The Integers The well-ordering property . Divisibitity Representations of integers... Computer operations with integers . Prime numbers. Greatest Common Divisors and Prime Factorization Greatest common divisors The Euclidean algorithm .. ‘The fundamental theorem of arithmetic Factorization of integers and the Fermat numbers. Linear diophantine equations .. Congruences Introduction to congruences Linear congruences... ‘The Chinese remainder theorem Systems of linear congruences... Applications of Congruences The perpetual calendar... Round-robin tournaments... Computer file storage and hashing functions. 18 24 33 45 53 58 69 79 87 1 102 107 116 129 134 139 141 Contents Chapter 5. 81 5.2 53 Chapter 6. 61 62 63 Chapter 7. a 72 73 14 78 16 Chapter 8. 81 82 83 a4 8.5 8.6 87 88 Chapter 9. 91 9.2 93 94 ‘Some Special Congruences Wilson’s theorem and Fermat's little theorem... Pscudoprimes. Euler’s theorem. Multiplicative Functions Euler's phi-function . The sum and number of divisors... Perfect numbers and Mersenne primes Cryptology Character ciphers Block ciphers. we o r Exponentiation Ciphers ....sssssscseeseesssesn Public-key cryptography Knapsack ciphers.. Some applications to computer science Primitive Roots The order of an integer and primitive roots. Primitive roots for PFIMeS ....nnee Existence of primitive roots... Index arithmetic ....... Primality testing using primitive root Universal exponents. Pseudo-random numbers The splicing of telephone cables... Quadratic Residues and Reciprocity Quadratic residues Quadratic reciprocity .. The Jacobi symbol... Euler pseudoprimes .. xi 147 152 161 166 174, 180 188 198 205 212 219 227 232 238 243 252 263 268 275 280 288 304 314 325 Chapter 10. 10.1 10.2 10.3 10.4 Chapter 11. Contents Decimal Fractions and Continued Fractions Decimal fractions. Finite continued fractions . Infinite continued fractions... ic continued fractions ‘Some Nonlinear Diophantine Equations Pythagorean triples. Fermat's last theorem Pell’s equa Appen Answers to selected problem: Bibliography List of symbols......... oe Index . . 336 350 361 375 391 397 401 410 426 438 445 447 Introduction Number theory, in a general sense, is the study of numbers and their properties. In this book, we primarily deal with the integers, 0, 1, #2, ... We will not axiomatically define the integers, or rigorously develop integer arithmetic.’ Instead, we discuss the interesting properties of and relationships between integers. In addition, we study the applications of number theory, particularly those directed towards computer science. ‘As far back as 5000 years ago, ancient civilizations had developed ways of expressing and doing arithmetic with integers, Throughout history, different methods have been used to denote integers. For instance, the ancient Babylonians used 60 as the base for their number system and the Mayans used 20. Our method of expressing integers, the decimal system, was first developed in India approximately six centuries ago. With the advent of modern computers, the binary system came into widespread use. Number theory has been used in many ways to devise algorithms for efficient computer arithmetic and for computer operations with large integers. The ancient Greeks in the school of Pythagoras, 2500 years ago, made the distinction between primes and composites. A prime is a positive integer with no positive factors other than one and the integer itself. In his writings, Euclid, an ancient Greek mathematician, included a proof that there are infinitely many primes. Mathematicians have long sought formulae that generate primes. For instance, Pierre de Fermat, the great French number theorist of the seventeenth century, thought that all integers of the form 2” + 1 are prime; that this is false was shown, a century after Fermat made this claim, by the renowned Swiss mathematician Leonard Euler, who demonstrated that 641 is a factor of 2” + 1 The problem of distinguishing primes from composites has been extensively studied. The ancient Greek scholar Eratosthenes devised a method, now called Such an axiomatic development of the integers and their arithmetic can be found in Landau (ot.

You might also like