ebook img

Prime Numbers and Computer Methods for Factorization PDF

480 Pages·1994·15.227 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Prime Numbers and Computer Methods for Factorization

Progress in Mathematics Volume 126 Series Editors J. Oesterle A. Weinstein Hans Riesel Prime Numbers and Computer Methods for Factorization Second Edition Springer Science+ Business Media, LLC Hans Riesel Department of Mathematics The Royal Institute of Technology S-I00 44 Stockholm Sweden Library of Congress Cataloging-in-Publication Data Riesel, Hans, 1929- Prime numbers and computer methods for factorization I Hans Riesel. --2nd ed. p. cm. --(Progress in mathematics ; v. 126) Includes bibliographical references and index. Contents: v. l. Fundamental algorithms ISBN 978-1-4612-6681-5 ISBN 978-1-4612-0251-6 (eBook) DOI 10.1007/978-1-4612-0251-6 l. Numbers, Prime--Data processing. 2. Factorization (Mathematics)--Data processing. I. Title. II. Series : Progress in mathematics (Boston, Mass.) ; vol. 126. II. Title. III. Series. QA246.R54 1994 94-27688 512'.72--dc20 CIP Printed on acid-free paper © Springer Science+Business Media New York 1994 Originally published by BirkMuser Boston in 1994 Softcover reprint oft he hardcover 2nd edition 1994 Copyright is not claimed for works of U.S. Government employees. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without prior permission of the copyright owner. Permission to photocopy for internal or personal use of specific clients is granted by Springer Science+Business Media, LLC for libraries and other users registered with the Copyright ClearanceCenter (CCC), provided that the base fee of $6.00 per copy, plus $0.20 per page is paid directly to CCC, 222 Rosewood Drive, Danvers, MA 01923, U.S.A. Special requests should be addressed directly to Springer Science+Business Media, LLC. ISBN 978-1-4612-6681-5 Typeset by the author. 9 8 7 654 3 2 1 PREFACE In this book the author treats four fundamental and apparently simple prob lems. They are: the number of primes below a given limit, the approximate number of primes, the recognition of prime numbers and the factorization of large numbers. A chapter on the details of the distribution of the primes is included as well as a short description of a recent application of prime numbers, the so-called RSA public-key cryptosystem. The author is also giving explicit algorithms and computer programs. Whilst not claiming completeness, the author has tried to give all important results known, including the latest discoveries. The use of comput ers has in this area promoted a development which has enormously enlarged the wealth of results known and that has made many older works and tables obsolete. As is often the case in number theory, the problems posed are easy to under stand but the solutions are theoretically advanced. Since this text is aimed at the mathematicaIly inclined layman, as weIl as at the more advanced student, not all of the proofs of the results given in this book are shown. Bibliographical references in these cases serve those readers who wish to probe deeper. References to recent original works are also given for those who wish to pursue some topic further. Since number theory is seldom taught in basic mathematics courses, the author has appended six sections containing all the algebra and number theory required for the main body of the book. There are also two sections on multiple precision computations and, finaIly, one section on Stieltjes integrals. This organization of the subject-matter has been chosen in order not to disrupt the reader's line of thought by long digressions into other areas. It is also the author's hope that the text, organized in this way, becomes more readable for specialists in the field. Any reader who gets stuck in the main text should first consult the appropriate appendix, and then try to continue. The six chapters of the main text are quite independent of each other, and need not be read in order. For those readers who have a computer (or even a programmable calculator) available, computer programs have been provided for many of the methods de scribed. In order to achieve a wide understanding, these programs are written in the high-level programming language PASCAL. With this choice the author hopes that most readers will be able to translate the programs into the language of the computer they use with reasonable effort. v PREFACE At the end of the book a large amount of results are collected in the form of tables, originating partly from the author's own work in this field. All tables have been verified and up-dated as far as possible. Also in connection with the tables, bibliographical references are given to recent or to more extensive work in the corresponding area. The text is an up-dated version of an earlier book by the same author: "En bok om primtal," existing in Swedish only. The author is very much indebted to Richard Brent, Arne Fransen, Gunnar Hellstrom, Hans Karlgren, D. H. Lehmer, Thorkil Naur, Andrzej Schinzel, Bob Vaughan and many others for their reading of the manuscript and for suggest ing many improvements. Thanks are also due to Beatrice Frock for revising the English, and to the late Ken Clements for reading and correcting one of the last versions of the manuscript. The author wishes you a pleasant reading! Stockholm, February 1985 PREFACE TO THE SECOND EDITION During the last ten years the science of computational number theory has seen great advances. Several important new methods have been introduced to recognize prime numbers and to factor composite integers. These advances have stimulated the author to add subsections on the applications of the elliptic curve method and on the number field sieve to the main text as well as two new appendices covering the basics of these new subjects.-Also, very many minor updatings and corrections of the text have been made. The author wishes to express his thanks to the many readers who have written during the years and proposed improvements of the text. Special thanks are going to Richard Brent, Fran~ois Morain, Peter Montgomery and in particular to Harvey Dubner and Wilfrid Keller, who all helped during various stages of the preparation of the new manuscript. Stockholm, June 1994 vi CONTENTS Chapter 1. The Number of Primes Below a Given Limit What Is a Prime Number? . . . . . . . . . . . 1 The Fundamental Theorem of Arithmetic ..... 2 Which Numbers Are Primes? The Sieve of Eratosthenes 2 General Remarks Concerning Computer Programs 4 A Sieve Program . . . . . . . 5 Compact Prime Tables . . . . . 7 Hexadecimal Compact Prime Tables 9 Difference Between Consecutive Primes 9 The Number of Primes Below x 10 Meissel's Formula 12 Evaluation of Pk (x, a) 12 Lehmer's Formula 13 Computations 14 A Computation Using Meissel's Formula 18 A Computation Using Lehmer's Formula 20 A Computer Program Using Lehmer's Formula 22 Mapes'Method 23 Deduction of Formulas 24 A Worked Example 26 Mapes' Algorithm 30 Programming Mapes' Algorithm 32 Recent Developments 33 Results ..... 34 Computational Complexity 35 Comparison Between the Methods Discussed 35 Bibliography ........ . 36 Chapter 2. The Primes Viewed at Large Introduction . . . . . . . . . . 37 No Polynomial Can Produce Only Primes 37 Formulas Yielding All Primes .... 39 The Distribution of Primes Viewed at Large. Euclid's Theorem 40 The Formulas of Gauss and Legendre for JT(x). The Prime Number Theorem ...... . 41 The Chebyshev Function O(x) 44 The Riemann Zeta-function 44 vii CONTENTS The Zeros of the Zeta-function 47 Conversion From f(x) Back to JT(x) 49 The Riemann Prime Number Formula 50 The Sign oflix - JT(x) • . . . . 52 The InHuence of the Complex Zeros of I;(s) on JT(x) 53 The Remainder Term in the Prime Number Theorem 56 Effective Inequalities for JT (x), P., and () (x) 56 The Number of Primes in Arithmetic Progressions 57 Bibliography ............ . 58 Chapter 3. Subtleties in the Distribution of Primes The Distribution of Primes in Short Intervals 60 Twins and Some Other Constellations of Primes 60 Admissible Constellations of Primes 62 The Hardy-Littlewood Constants 64 The Prime k-Thples Conjecture 66 Theoretical Evidence in Favour of the Prime k-Thples Conjecture 67 Numerical Evidence in Favour of the Prime k-Thples Conjecture 68 The Second Hardy-Littlewood Conjecture 68 The Midpoint Sieve . . . . . . . . 70 Modification of the Midpoint Sieve 70 Construction of Superdense Admissible Constellations 71 Some Dense Clusters of Primes . . . . . . . . 73 The Distribution of Primes Between the 1\\'0 Series 4n + I and 4n + 3 73 Graph of the Function JT4.3(X) - JT4.I(X) 74 The Negative Regions ..... . 74 The Negative Blocks . . . . . . . 77 Large Gaps Between Consecutive Primes 78 The Cramer Conjecture 79 Bibliography 82 Chapter 4. The Recognition of Primes Introduction . . . . . . . . . . . . . 84 Tests of Primality and of Compositeness . . . 84 Factorization Methods as Tests of Compositeness 85 Fermat's Theorem as Compositeness Test 85 Fermat's Theorem as Primality Test 85 Pseudoprimes and Probable Primes 86 A Computer Program for Fermat's Test 87 The Labor Involved in a Fermat Test 88 Carmichael Numbers 89 Euler Pseudo primes ..... 90 Strong Pseudoprimes and a Primality Test 91 A Computer Program for Strong Pseudoprime Tests 93 Counts of Pseudoprimes and Carmichael Numbers 94 viii CONTENTS Rigorous Primality Proofs . . . . . . 95 Lehmer's Converse of Fermat's Theorem 96 Formal Proof of Theorem 4.3 . . . 97 Ad Hoc Search for a Primitive Root 98 The Use of Several Bases 99 Fermat Numbers and Pepin's Theorem 100 Cofactors of Fermat Numbers 102 Generalized Fermat Numbers 102 A Relaxed Converse of Fermat's Theorem 103 Proth's Theorem 104 Tests of Compositeness for Numbers of the form N = h . 2" ± k 105 An Alternative Approach 105 Certificates of Primality 106 Primality Tests of Lucasian Type 107 Lucas Sequences 107 The Fibonacci Numbers 108 Large Subscripts 108 An Alternative Deduction 111 Divisibility Properties of the Numbers U" 112 Primality Proofs by Aid of Lucas Sequences 115 Lucas Tests for Mersenne Numbers 117 A Relaxation of Theorem 4.8 . 120 Pocklington's Theorem . . . . 121 Lehmer-Pocklington's Theorem 122 Pocklington-Type Theorems for Lucas Sequences 123 Primality Tests for Integers of the form N = h ·2" - 1, when 3th 124 Primality Tests for N = h . 2" - 1, when 31h 125 The Combined N - I and N + 1 Test 129 Lucas Pseudoprimes . . . . 130 Modem Primality Proofs 130 The Jacobi Sum Primality Test 131 Three Lemmas . 132 Lenstra's Theorem ... . 134 The Sets P and Q ... . 135 Running Time for the APRCL Test 136 Elliptic Curve Primality Proving, ECPP 136 The Goldwasser-Kilian Test 137 Atkin's Test 138 Bibliography 139 Chapter 5. Classical Methods of Factorization Introduction . . . . . . . . . 141 When Do We Attempt Factorization? . . . 141 Trial Division . . . . . . . . . . . 141 A Computer Implementation of Trial Division 143 Euclid's Algorithm as an Aid to Factorization 145 ix CONTENTS Fermat's Factoring Method 147 Legendre's Congruence . 149 Euler's Factoring Method 151 Gauss' Factoring Method 152 Legendre's Factoring Method 155 The Number of Prime Factors of Large Numbers 156 How Does a Typical Factorization Look? 157 The Erdos-Kac Theorem ....... . 158 The Distribution of Prime Factors of Various Sizes 159 Dickman's Version of Theorem 5.4 161 A More Detailed Theory ...... . 161 The Size of the kth Largest Prime Factor of N 162 Smooth Integers ......... . 164 Searching for Factors of Certain Forms 165 Legendre's Theorem for the Factors of N = an ± bn 165 Adaptation to Search for Factors of the Form p = 2kn + I 169 Adaptation of Trial Division . . . . . . . . . . . 169 Adaptation of Fermat's Factoring Method . . . . . . 170 Adaptation of Euclid's Algorithm as an Aid to Factorization 171 Bibliography ............... . 171 Chapter 6. Modem Factorization Methods Introduction . . . . . 173 Choice of Method . . . . . 173 Pollard's (p - I)-Method . . 174 Phase 2 of the (p - I)-Method 176 The (p + I)-Method . . . . 177 Pollard's rho Method 177 A Computer Program for Pollard's rho Method 180 An Algebraic Description of Pollard's rho Method 182 Brent's Modification of Pollard's rho Method 183 The Pollard-Brent Method for p = 2kn + 1 185 Shanks' Factoring Method SQUFOF 186 A Computer Program for SQUFOF 190 Comparison Between Pollard's rho Method and SQUFOF 193 Morrison and Brillhart's Continued Fraction Method CFRAC 193 The Factor Base ......... . 194 An Example of a Factorization with CFRAC 196 Further Details of CFRAC . . 200 The Early Abort Strategy 202 Results Achieved with CFRAC 203 Running Time Analysis of CFRAC 204 The Quadratic Sieve, QS 204 Smallest Solutions to Q(x) == 0 mod p 205 Special Factors . . . . 206 Results Achieved with QS . . . . 206 x

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.