# Mathematics of Computation, Vol. 41, No (Jul., 1983), pp

Save this PDF as:

Size: px
Start display at page:

Download "Mathematics of Computation, Vol. 41, No. 163. (Jul., 1983), pp. 287-294."

## Transcription

2 MATHEMATICS OF COMPUTATION VOLUME 41. NUMBER 163 JULY PAGES Factoring Large Numbers With a Quadratic Sieve By Joseph L. Gerver Ab\h.act. The quadratic sieve algorithm was used to factor a 47-digit number into primes. A comparison with Wagstaff's results using the continued fraction early abort algorithm suggests that QS should be faster than CFEA when the number being factored exceeds 60 digits (plus or minus ten or more digits, depending on details of the hardaare and software). I. Introduction. Pomerance [7] has shown that, if one makes certain reasonable but unproved assumptions, his quadratic sieve algorithm (QS) is asymptotically faster than any other known general algorithm for factoring large numbers, with the possible exception of a very recent algorithm of Schnorr [8]. In particular, for sufficiently large numbers, the quadratic sieve algorithm is faster than the continued algorithm (CF) of Brillhart and Morrison 161, even if the latter includes the early abort modification (CFEA). I have recently used the quadratic sieve algorithm to factor the 47-digit number , a factor of which was known [l] to be composite but had never been factored, into three prime factors: , , and Wagstaff [9] has recently used both CF and CFEA to factor several 47-digit numbers. A comparison of the execution times for these programs indicates that QS becomes faster than CF when the number to be factored exceeds 40 digits, and faster than CFEA when the number exceeds 60 digits. However, the ratio of the running time of QS to each of the other algorithms is quite insensitive to the size of the factored number. Thus the break-even points of 40 and 60 digits could easily be off by -f 10 digits, depending on details of the hardware and software. 11. Description of the Algorithms. All modern general factoring algorithms (i.e. algorithms which do not require the factored number to be of any special form) are based on Fermat's observation that a composite number n can be factored if one can find two squares x2 y2 (mod n), such that x r i- y (mod n). For then n 1 (x" yyz)= (X+ y)(x - y) but n does not divide x + y or x - y; hence the greatest common divisors (n, x + y) and (n, x - y) are proper factors of n. To find two such squares, one starts with a factor base of k primes, p,,...,p,, and then searches for sequences of integers a,,...,a,+, and b,,...,b,,, such that, for each i, u,? E h, (mod n) and b, can be completely factored over the factor base; i.e. Rcccivcd Junc Mtrrhc~~lcrrrc..~ Sri11lcc.r ('lu.s.s(ic~crrror~. Primary 10A25; Secondary C American Mathematical Society /83/ /\$04.75

3 288 JOSEPH L. <ierver For each 1, let i7, = (v,,,...,v,,) be the vector over the integers mod2 such that, for each j, v,, c,, (mod2). There must exist a linear dependency among the vectors A d v,,...,oh+,, and hence a set S such that Z,., C;, = 0. Therefore IIIE, b, is a perfect square, y2, which is congruent (mod n) to x2 = II,,, a,?. If the a, are chosen at random [4], there is a 50% chance (or more if n is the product of more than two primes) that x Z -. y (mod n). If x is congruent to ey,one simply finds another pair a,+,, b,+,, and another linear dependency, and tries again until n is factored. For CF, one searches for the a,'s among the numerators of the continued fraction convergents of fi. To test whether a candidate for b, can be factored over the factor base, one must try to divide it by each prime p,. In CFEA, these trial divisions are aborted if the candidate fails too many of the early ones. For QS, one searches for the a,'s among consecutive integers starting with [fi], the integral part of fi.it is only necessary to divide n and [fi] by eachp, and solve a quadratic congruence mod p,. After that, large blocks of possible b,'s can be sieved at once, and no trial divisions are needed Implementation of the Quadratic Sieve. The quadratic sieve algorithm was implemented with a FORTRAN program on an HP3000/series 3 computer. The initial factor base contained 1000 elements, namely the first 999 primes modulo which n (the number factored) is a quadratic residue, plus the "prime" -1. The element - 1 was included so that the numbers b, could be negative as well as positive, thus doubling the number of candidates for b, less than a given absolute value. First, the quadratic congruence ([d;] +z) 2 - n 0 (modp) was solved for p equal to each prime in the factor base, and also modulo the squares of all the primes, the cubes of all primes less than 130, and higher powers of the smallest primes. This process required 7 minutes of CPU time, using a fast algorithm in the spirit of Lehmer [5]. The integers [fi]+ m were then sieved, in blocks of 10000, for m up to 400, and down to -499,999,999. Each block was sieved by initially setting each element of a element array, SUMLOG, to the logarithm of the corresponding integer in each block. Then, for each odd prime p in the factor base, the logarithm of p was subtracted from SUMLOG(J), where J was initially set to z, and z,, respectively, the two solutions of the above congruence, and then increased by increments of p until J was greater than The final values of J were then decreased by and stored, to be used as initial values for the next block. This procedure was then repeated for p2, and, where appropriate, for higher powers of p. For powers of p too high to be included in the sieve, trial division was employed where necessary. The same procedure was then used for powers of two, except that J was incremented by the previous power of two, since in this case n 1 (mod 8), and therefore the quadratic congruences modulo powers of two have four solutions each. To speed thngs up by using fixed-point instead of floating-point arithmetic, and to conserve memory, all logarithms were taken to be the integral part of 10 log,. After sieving with all primes and prime powers, the array SUMLOG was scanned to pick out values close to zero, which would indicate a number b, = ([fi]+ rn), - n

4 FACTORIKC; LARGE KUMBERS WITH A QUADRATIC SIEVE 289 completely factored into primes in the factor base. For each such b,, the vector 6, was computed and stored, along with m, in a disc file. Altogether, 327 such numbers were found. In addition, SUMLOG was scanned to pick out values less than twice the log of p,,, the largest prime in the factor base. These elements of SUMLOG corresponded to numbers b, which factored into primes in the factor base, except for one larger factor which was less than p:, and hence prime. The vectors for these numbers, in all, were also stored in a disc file, along with the large prime factor of each. The file was then searched for pairs of numbers with the same large prime factor, and 690 such pairs were found (including several triplets, each counted as two pairs). A total of 70 hours of CPU time was required for the sieving, plus another 8 minutes to find the 690 matching pairs. Very little of the 70 hours (less than one hour) was spent processing numbers b, after they had been found. Each component v,, of the vectors was stored as a single bit; thus sixteen components were stored in each 16-bit word, and 63 words sufficed for each vector. As each matching pair of numbers was found, the two vectors were added together to cancel out the common large prime factor. The 690 vector s thus formed were combined with the 327 vectors of the completely factored numbers to form a 1017 X 1000 matrix. This matrix was then reduced by Gaussian elimination, and 27 different linear dependencies were found. All vector additions were done using the logical operation XOR (equivalent to addition in the integers mod 2) so 16 pairs of components could be added in a single operation. Despite the packing of the matrix into 1017 X 63 sixteen-bit words, the entire matrix could not fit into the word maximum data stack of the HP3000. The matrix reduction routine therefore used virtual memory, with no more than 208 rows of the matrix in the core memory at any time. The reduction of the matrix required 340 seconds of CPU time. Of this time, approximately 90 seconds were spent on row operations, and the rest on reading and writing to the disc file and searchng for rows with a 1 in a given column. The distinction is important because the time required for row operations is proportional to k3(where k is the number of elements in the factor base) while the time required for the other procedures is proportional to k2. (If the core memory is held fixed, then the time required for reading and writing also grows as k3,but we shall show in Section V that with an efficient program this time is small compared to the time for row operations.) Once the matrix was reduced, a few more minutes were required to factor n. Fortunately it was not necessary to calculate x and y (whch would have taken several hours, since these numbers have thousands of digits), but only their residues (mod n). The residue of x was computed by taking the product of all at's in Z mod n. To compute the residue of y, each b, was represented as the formal product of primes, and these primes were combined to yield y2 as a formal product. Each exponent of ths formal product was then divided by two, and the prime factors multiplied together in Z mod n. IV. Comparison of Running Times. Let L = ejg=zg.

5 For all factoring algorithms of the kind discussed in this paper, the time required to factor n is believed to be a function of the form L" -t- O( I ) where a is a constant and o(l) - 0 as n - oo. For each algorithm, this belief can be proved [7] and the value of a computed if we assume that the special numbers among which one searches for the b,'s are just as likely to factor into small primes as random numbers of the same order of magnitude. For CF, a = 0, for CFEA, a = 6/ 0, and for QS, a = 36/4 (this last value can be improved slightly by using the Coppersmith-Winograd method [3] to reduce the matrix, but this is not practical for reasonable values of n). The optimum size, k, for the factor base is ~Pi-o(l), where /3 = fi/4 for both CF and QS, and 1/ 6for CFEA. Both a and /3 are asymptotic values. However, one would expect QS to be slower than CF and CFEA for small n for the following reason: Let a/c be a continued fraction convergent to,hi, and let b = a2 - c2n. Then b = 0(&), and the probability that b can be factored over the factor base is u-~+"("), where r u = log \~n/log p, (p, being the largest prime on the factor base) 121. To find k such numbers, one would expect to have to search M = kuu+~(u) continued fraction convergents. On the other hand, if we use QS, with a = [fi] + m and b = a2 - n, then b = O(m,6-),and - u = (log m + log in )/log p, Typically, m is on the order of M. the total number of numbers sieved, so we can estimate M by simultaneously solving the two equations u = (log M + log fi)/log p, and M = kuu.for very large n, the term log M becomes unimportant in that it does not affect the value of a or j3. However, for n = lo4', log45 = 23.5 log 10 and, even for CF and CFEA, M is typically [9] around 2 X lo7 (slightly larger if n is not a quadratic residue mod 3,5, and 8), so log M = 7 log 10, a significant fraction of logfi Hence u is significantly larger for QS than for CF and CFEA and M must also be larger; as we have seen it is just under 9 X 10' in this instance. We save time by testing numbers with a sieve instead of trial division, but for small n we lose more time than we save because we have more numbers to test (see also Section 9 of [7]). Furthermore, to minimize the running time of QS, we should choose k so that the sieving time is on the same order as the matrix reduction time. Thus any increase in the sieving time implies an increase in the optimum size of k. We would therefore expect k to be larger for QS than for CF although both algorithms have the same value of j3. Empirical data on ths question is not available for CF, since Wagstaff [9] used only one value of k, viz For QS, k = 1000 is too small, since the sieving time (70 hours) is much greater than the matrix reduction time (5 minutes) with thls value of k.

6 FACTORING LARGE NUMBERS WITH A QUADRATIC SIEVE To estimate the optimum value of k for QS, let k =,5fi/4+8, where / S / is small. Then from [7] we have Note that = Lfi/4~8+(fi+4~)-'+o(1) so that Thus for 6 near 0, we have km approximately constant, provided the error term o(1) does not behave too wildly. The time required to sieve a given interval only grows as " - = O(1og log k).,=i p, Therefore the sieving time should be inversely proportional to k. The matrix reduction time, with Gaussian elimination, is proportional to k3. Therefore, to minimize the total time, the sieving time should be about three times the matrix reduction time. If we naively extrapolate from k = 1000, we obtain an optimum value of k = 5000, with a sieving time of 70/5 = 14 hours, and a matrix reduction time of 1.5 X X 52 minutes = 5 hours. I attempted to implement the quadratic sieve algorithm with a factor base of 4700 primes, but it soon became clear that this was not practical on the HP3000 without a major modification of the program. For one thing, the data stack was not large enough to hold all 4700 primes, along with a logarithm and both solutions of a quadratic congruence for each prime. It was therefore necessary to use virtual memory, and this increased the sieving time by a factor of three, although it should be possible to write a more efficient virtual memory program, as we shall see. It was also necessary to ignore those b, which had a large prime factor (the "large prime variation") and include only those which factored entirely over the factor base; otherwise too much time would have been spent processing the numbers b, after they had been found. This increased the sieving time by another factor of three over the naive extrapolation discussed above. However, I was able to confirm empirically that M varies inversely with k, since three of the first lo6 numbers sieved were completely factored over a factor base of 1000, while eight of the first lo5 numbers factored over a factor base of It would appear that if core memory was not an obstacle, or a more efficient virtual memory program was employed, k should be about 7000 for n on the order of lo4'. This would give a sieving time of about 30 hours (since the large prime variation cannot be used) and a matrix reduction time of 12 hours. Both times would likely be somewhat less, the former because the numbers being sieved would be smaller on the average than they are for k = 1000 (and therefore more likely to factor), and the latter because the matrix would be sparser. We will assume a total running time of 40 hours.

9 294 JOSEPH L. GERVER 1. J. BRILLHART. D. H. LEHMER. J. L. SELFRIDGE. B. TUCKERMAN & S. S. WAGSTAFF, Jr.. "Factorizations of b" 2 1 up to high powers." (To appear). 2. E. R. CANFIELD. P. ERDOS& C. POMERANCE. ''On a problem of Oppenheim concerning 'Factorisatio Numerorum'." J. Nunlher Theon,. (To appear.) 3. D. COPPERSMITH & S. WINOGRAD, "On the asymptotic complexity of matrix multiplication." SIAM J. Conlput. (To appear.) 4. J. D. DIXON. "Asymptotically fast factorization of integers." Muth. Conlp., v. 36, pp D. H. LEHMER. "Computer technology applied to the theory of numbers." in Studies rrl Nunlher Tlleorp (W. J. LeVeque, ed.). Math. Assoc. Amer., 1969, pp M. A. MORRISON & J. BRILLHART, "A method of factoring and the factorization of F,." Mutlt. Conlp.. v. 29, 1975, pp C. POMERANCE. "Analysis and comparison of some factoring algorithms," in Con~pututior~ul Methods rtl Number Tlleorv (H. W. Lenstra, Jr. and R. Tijdeman, eds.). Math. Centrum. Amsterdam. (To appear.) 8. C. P. SCHNORR, private correspondence dated 1982 (communicated to the author by C. Pomerance). 9. S. S. WAGSTAFF. JR.. private correspondence dated M. C. WUNDERLICH. "A running time analysis of Brillhart's continued fraction factoring method," in Number Tlleon Curbot~dule 1979 (M. B. Nathanson, ed.), Lecture Notes in Math., Vol Springer- Verlag, 1979, pp

### Notes on Factoring. MA 206 Kurt Bryan

The General Approach Notes on Factoring MA 26 Kurt Bryan Suppose I hand you n, a 2 digit integer and tell you that n is composite, with smallest prime factor around 5 digits. Finding a nontrivial factor

### Integer Factorization using the Quadratic Sieve

Integer Factorization using the Quadratic Sieve Chad Seibert* Division of Science and Mathematics University of Minnesota, Morris Morris, MN 56567 seib0060@morris.umn.edu March 16, 2011 Abstract We give

### The Quadratic Sieve Factoring Algorithm

The Quadratic Sieve Factoring Algorithm Eric Landquist MATH 488: Cryptographic Algorithms December 14, 2001 1 Introduction Mathematicians have been attempting to find better and faster ways to factor composite

### Optimization of the MPQS-factoring algorithm on the Cyber 205 and the NEC SX-2

Optimization of the MPQS-factoring algorithm on the Cyber 205 and the NEC SX-2 Walter Lioen, Herman te Riele, Dik Winter CWI P.O. Box 94079, 1090 GB Amsterdam, The Netherlands ABSTRACT This paper describes

### Factoring. Factoring 1

Factoring Factoring 1 Factoring Security of RSA algorithm depends on (presumed) difficulty of factoring o Given N = pq, find p or q and RSA is broken o Rabin cipher also based on factoring Factoring like

### U.C. Berkeley CS276: Cryptography Handout 0.1 Luca Trevisan January, 2009. Notes on Algebra

U.C. Berkeley CS276: Cryptography Handout 0.1 Luca Trevisan January, 2009 Notes on Algebra These notes contain as little theory as possible, and most results are stated without proof. Any introductory

### Determining the Optimal Combination of Trial Division and Fermat s Factorization Method

Determining the Optimal Combination of Trial Division and Fermat s Factorization Method Joseph C. Woodson Home School P. O. Box 55005 Tulsa, OK 74155 Abstract The process of finding the prime factorization

### Factoring Algorithms

Factoring Algorithms The p 1 Method and Quadratic Sieve November 17, 2008 () Factoring Algorithms November 17, 2008 1 / 12 Fermat s factoring method Fermat made the observation that if n has two factors

### An Overview of Integer Factoring Algorithms. The Problem

An Overview of Integer Factoring Algorithms Manindra Agrawal IITK / NUS The Problem Given an integer n, find all its prime divisors as efficiently as possible. 1 A Difficult Problem No efficient algorithm

### Arithmetic algorithms for cryptology 5 October 2015, Paris. Sieves. Razvan Barbulescu CNRS and IMJ-PRG. R. Barbulescu Sieves 0 / 28

Arithmetic algorithms for cryptology 5 October 2015, Paris Sieves Razvan Barbulescu CNRS and IMJ-PRG R. Barbulescu Sieves 0 / 28 Starting point Notations q prime g a generator of (F q ) X a (secret) integer

### http://wrap.warwick.ac.uk/

Original citation: Hart, William B.. (2012) A one line factoring algorithm. Journal of the Australian Mathematical Society, Volume 92 (Number 1). pp. 61-69. ISSN 1446-7887 Permanent WRAP url: http://wrap.warwick.ac.uk/54707/

### Factorization Methods: Very Quick Overview

Factorization Methods: Very Quick Overview Yuval Filmus October 17, 2012 1 Introduction In this lecture we introduce modern factorization methods. We will assume several facts from analytic number theory.

### Operation Count; Numerical Linear Algebra

10 Operation Count; Numerical Linear Algebra 10.1 Introduction Many computations are limited simply by the sheer number of required additions, multiplications, or function evaluations. If floating-point

### Factoring Algorithms

Institutionen för Informationsteknologi Lunds Tekniska Högskola Department of Information Technology Lund University Cryptology - Project 1 Factoring Algorithms The purpose of this project is to understand

### Mathematics of Cryptography Part I

CHAPTER 2 Mathematics of Cryptography Part I (Solution to Odd-Numbered Problems) Review Questions 1. The set of integers is Z. It contains all integral numbers from negative infinity to positive infinity.

### Homework 5 Solutions

Homework 5 Solutions 4.2: 2: a. 321 = 256 + 64 + 1 = (01000001) 2 b. 1023 = 512 + 256 + 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = (1111111111) 2. Note that this is 1 less than the next power of 2, 1024, which

### Math Review. for the Quantitative Reasoning Measure of the GRE revised General Test

Math Review for the Quantitative Reasoning Measure of the GRE revised General Test www.ets.org Overview This Math Review will familiarize you with the mathematical skills and concepts that are important

### Primality - Factorization

Primality - Factorization Christophe Ritzenthaler November 9, 2009 1 Prime and factorization Definition 1.1. An integer p > 1 is called a prime number (nombre premier) if it has only 1 and p as divisors.

### Elementary Number Theory We begin with a bit of elementary number theory, which is concerned

CONSTRUCTION OF THE FINITE FIELDS Z p S. R. DOTY Elementary Number Theory We begin with a bit of elementary number theory, which is concerned solely with questions about the set of integers Z = {0, ±1,

### Homework until Test #2

MATH31: Number Theory Homework until Test # Philipp BRAUN Section 3.1 page 43, 1. It has been conjectured that there are infinitely many primes of the form n. Exhibit five such primes. Solution. Five such

### Cryptography and Network Security Chapter 8

Cryptography and Network Security Chapter 8 Fifth Edition by William Stallings Lecture slides by Lawrie Brown (with edits by RHB) Chapter 8 Introduction to Number Theory The Devil said to Daniel Webster:

### Breaking The Code. Ryan Lowe. Ryan Lowe is currently a Ball State senior with a double major in Computer Science and Mathematics and

Breaking The Code Ryan Lowe Ryan Lowe is currently a Ball State senior with a double major in Computer Science and Mathematics and a minor in Applied Physics. As a sophomore, he took an independent study

### Applications of Fermat s Little Theorem and Congruences

Applications of Fermat s Little Theorem and Congruences Definition: Let m be a positive integer. Then integers a and b are congruent modulo m, denoted by a b mod m, if m (a b). Example: 3 1 mod 2, 6 4

### Factorizations of a n ± 1, 13 a < 100

Factorizations of a n ± 1, 13 a < 100 Richard P. Brent Computer Sciences Laboratory, Australian National University GPO Box 4, Canberra, ACT 2601, Australia e-mail: rpb@cslab.anu.edu.au and Herman J. J.

### CONTINUED FRACTIONS AND FACTORING. Niels Lauritzen

CONTINUED FRACTIONS AND FACTORING Niels Lauritzen ii NIELS LAURITZEN DEPARTMENT OF MATHEMATICAL SCIENCES UNIVERSITY OF AARHUS, DENMARK EMAIL: niels@imf.au.dk URL: http://home.imf.au.dk/niels/ Contents

### Mathematics of Cryptography Modular Arithmetic, Congruence, and Matrices. A Biswas, IT, BESU SHIBPUR

Mathematics of Cryptography Modular Arithmetic, Congruence, and Matrices A Biswas, IT, BESU SHIBPUR McGraw-Hill The McGraw-Hill Companies, Inc., 2000 Set of Integers The set of integers, denoted by Z,

### Smooth numbers and the quadratic sieve

Algorithmic Number Theory MSRI Publications Volume 44, 2008 Smooth numbers and the quadratic sieve CARL POMERANCE ABSTRACT. This article gives a gentle introduction to factoring large integers via the

### Revised Version of Chapter 23. We learned long ago how to solve linear congruences. ax c (mod m)

Chapter 23 Squares Modulo p Revised Version of Chapter 23 We learned long ago how to solve linear congruences ax c (mod m) (see Chapter 8). It s now time to take the plunge and move on to quadratic equations.

### http://www.jstor.org This content downloaded on Tue, 19 Feb 2013 17:28:43 PM All use subject to JSTOR Terms and Conditions

A Significance Test for Time Series Analysis Author(s): W. Allen Wallis and Geoffrey H. Moore Reviewed work(s): Source: Journal of the American Statistical Association, Vol. 36, No. 215 (Sep., 1941), pp.

### In a triangle with a right angle, there are 2 legs and the hypotenuse of a triangle.

PROBLEM STATEMENT In a triangle with a right angle, there are legs and the hypotenuse of a triangle. The hypotenuse of a triangle is the side of a right triangle that is opposite the 90 angle. The legs

### International Journal of Information Technology, Modeling and Computing (IJITMC) Vol.1, No.3,August 2013

FACTORING CRYPTOSYSTEM MODULI WHEN THE CO-FACTORS DIFFERENCE IS BOUNDED Omar Akchiche 1 and Omar Khadir 2 1,2 Laboratory of Mathematics, Cryptography and Mechanics, Fstm, University of Hassan II Mohammedia-Casablanca,

### Runtime and Implementation of Factoring Algorithms: A Comparison

Runtime and Implementation of Factoring Algorithms: A Comparison Justin Moore CSC290 Cryptology December 20, 2003 Abstract Factoring composite numbers is not an easy task. It is classified as a hard algorithm,

### SQUARE-SQUARE ROOT AND CUBE-CUBE ROOT

UNIT 3 SQUAREQUARE AND CUBEUBE (A) Main Concepts and Results A natural number is called a perfect square if it is the square of some natural number. i.e., if m = n 2, then m is a perfect square where m

### Factoring & Primality

Factoring & Primality Lecturer: Dimitris Papadopoulos In this lecture we will discuss the problem of integer factorization and primality testing, two problems that have been the focus of a great amount

### Continued Fractions and the Euclidean Algorithm

Continued Fractions and the Euclidean Algorithm Lecture notes prepared for MATH 326, Spring 997 Department of Mathematics and Statistics University at Albany William F Hammond Table of Contents Introduction

### = 2 + 1 2 2 = 3 4, Now assume that P (k) is true for some fixed k 2. This means that

Instructions. Answer each of the questions on your own paper, and be sure to show your work so that partial credit can be adequately assessed. Credit will not be given for answers (even correct ones) without

### Study of algorithms for factoring integers and computing discrete logarithms

Study of algorithms for factoring integers and computing discrete logarithms First Indo-French Workshop on Cryptography and Related Topics (IFW 2007) June 11 13, 2007 Paris, France Dr. Abhijit Das Department

### ' DEC SRC, 130 Lytton Avenue, Palo Alto, CA 94301, U.S.A

On the factorization of RSA-120 T. Denny1, B. Dodson2, A. K. Lenstra3, M. S. Manasse4 * Lehrstuhl Prof. Buchmann, Fachbereich Informatik, Universitit des Saarlandes, Postfach 1150, 66041 Saarbriicken,

### Lecture 4 Representing Data on the Computer. Ramani Duraiswami AMSC/CMSC 662 Fall 2009

Lecture 4 Representing Data on the Computer Ramani Duraiswami AMSC/CMSC 662 Fall 2009 x = ±(1+f) 2 e 0 f < 1 f = (integer < 2 52 )/ 2 52-1022 e 1023 e = integer Effects of floating point Effects of floating

### The number field sieve

The number field sieve A.K. Lenstra Bellcore, 435 South Street, Morristown, NJ 07960 H.W. Lenstra, Jr. Department of Mathematics, University of California, Berkeley, CA 94720 M.S. Manasse DEC SRC, 130

### ECE 842 Report Implementation of Elliptic Curve Cryptography

ECE 842 Report Implementation of Elliptic Curve Cryptography Wei-Yang Lin December 15, 2004 Abstract The aim of this report is to illustrate the issues in implementing a practical elliptic curve cryptographic

### CSE373: Data Structures and Algorithms Lecture 3: Math Review; Algorithm Analysis. Linda Shapiro Winter 2015

CSE373: Data Structures and Algorithms Lecture 3: Math Review; Algorithm Analysis Linda Shapiro Today Registration should be done. Homework 1 due 11:59 pm next Wednesday, January 14 Review math essential

### Number Theory Hungarian Style. Cameron Byerley s interpretation of Csaba Szabó s lectures

Number Theory Hungarian Style Cameron Byerley s interpretation of Csaba Szabó s lectures August 20, 2005 2 0.1 introduction Number theory is a beautiful subject and even cooler when you learn about it

### CHAPTER 5. Number Theory. 1. Integers and Division. Discussion

CHAPTER 5 Number Theory 1. Integers and Division 1.1. Divisibility. Definition 1.1.1. Given two integers a and b we say a divides b if there is an integer c such that b = ac. If a divides b, we write a

### Mathematics of Cryptography

CHAPTER 2 Mathematics of Cryptography Part I: Modular Arithmetic, Congruence, and Matrices Objectives This chapter is intended to prepare the reader for the next few chapters in cryptography. The chapter

### FACTORING WITH TWO LARGE PRIMES

mathematics of computation volume 63, number 208 october 1994, pages 785-798 FACTORING WITH TWO LARGE PRIMES A. K. LENSTRA AND M. S. MANASSE Abstract. We describe a modification to the well-known large

### If A is divided by B the result is 2/3. If B is divided by C the result is 4/7. What is the result if A is divided by C?

Problem 3 If A is divided by B the result is 2/3. If B is divided by C the result is 4/7. What is the result if A is divided by C? Suggested Questions to ask students about Problem 3 The key to this question

### k, then n = p2α 1 1 pα k

Powers of Integers An integer n is a perfect square if n = m for some integer m. Taking into account the prime factorization, if m = p α 1 1 pα k k, then n = pα 1 1 p α k k. That is, n is a perfect square

### The mathematics of RAID-6

The mathematics of RAID-6 H. Peter Anvin 1 December 2004 RAID-6 supports losing any two drives. The way this is done is by computing two syndromes, generally referred P and Q. 1 A quick

### Characterizing the Sum of Two Cubes

1 3 47 6 3 11 Journal of Integer Sequences, Vol. 6 (003), Article 03.4.6 Characterizing the Sum of Two Cubes Kevin A. Broughan University of Waikato Hamilton 001 New Zealand kab@waikato.ac.nz Abstract

### 3 Some Integer Functions

3 Some Integer Functions A Pair of Fundamental Integer Functions The integer function that is the heart of this section is the modulo function. However, before getting to it, let us look at some very simple

### Continued Fractions. Darren C. Collins

Continued Fractions Darren C Collins Abstract In this paper, we discuss continued fractions First, we discuss the definition and notation Second, we discuss the development of the subject throughout history

### PURSUITS IN MATHEMATICS often produce elementary functions as solutions that need to be

Fast Approximation of the Tangent, Hyperbolic Tangent, Exponential and Logarithmic Functions 2007 Ron Doerfler http://www.myreckonings.com June 27, 2007 Abstract There are some of us who enjoy using our

### SOLUTIONS FOR PROBLEM SET 2

SOLUTIONS FOR PROBLEM SET 2 A: There exist primes p such that p+6k is also prime for k = 1,2 and 3. One such prime is p = 11. Another such prime is p = 41. Prove that there exists exactly one prime p such

### PRIME FACTORS OF CONSECUTIVE INTEGERS

PRIME FACTORS OF CONSECUTIVE INTEGERS MARK BAUER AND MICHAEL A. BENNETT Abstract. This note contains a new algorithm for computing a function f(k) introduced by Erdős to measure the minimal gap size in

### Number Theory. Proof. Suppose otherwise. Then there would be a finite number n of primes, which we may

Number Theory Divisibility and Primes Definition. If a and b are integers and there is some integer c such that a = b c, then we say that b divides a or is a factor or divisor of a and write b a. Definition

### The mathematics of RAID-6

The mathematics of RAID-6 H. Peter Anvin First version 20 January 2004 Last updated 20 December 2011 RAID-6 supports losing any two drives. syndromes, generally referred P and Q. The way

### FACTORING POLYNOMIALS IN THE RING OF FORMAL POWER SERIES OVER Z

FACTORING POLYNOMIALS IN THE RING OF FORMAL POWER SERIES OVER Z DANIEL BIRMAJER, JUAN B GIL, AND MICHAEL WEINER Abstract We consider polynomials with integer coefficients and discuss their factorization

### THE NUMBER OF REPRESENTATIONS OF n OF THE FORM n = x 2 2 y, x > 0, y 0

THE NUMBER OF REPRESENTATIONS OF n OF THE FORM n = x 2 2 y, x > 0, y 0 RICHARD J. MATHAR Abstract. We count solutions to the Ramanujan-Nagell equation 2 y +n = x 2 for fixed positive n. The computational

### Factoring with the Quadratic Sieve on Large Vector Computers

Factoring with the Quadratic Sieve on Large Vector Computers Herman te Riele, Walter Lioen and Dik Winter Centre for Mathematics and Computer Science P.O. Box 4079, 1009 AB Amsterdam, The Netherlands The

### Update # 5 to Factorizations of b n ± 1

Update # 5 to Factorizations of b n ± 1 Samuel S. Wagstaff, Jr. The following tables present the updates made to Factorizations of b n ± 1from October 23, 1982, when the first edition went to press, to

### 8 Primes and Modular Arithmetic

8 Primes and Modular Arithmetic 8.1 Primes and Factors Over two millennia ago already, people all over the world were considering the properties of numbers. One of the simplest concepts is prime numbers.

### Clock Arithmetic and Modular Systems Clock Arithmetic The introduction to Chapter 4 described a mathematical system

CHAPTER Number Theory FIGURE FIGURE FIGURE Plus hours Plus hours Plus hours + = + = + = FIGURE. Clock Arithmetic and Modular Systems Clock Arithmetic The introduction to Chapter described a mathematical

### Settling a Question about Pythagorean Triples

Settling a Question about Pythagorean Triples TOM VERHOEFF Department of Mathematics and Computing Science Eindhoven University of Technology P.O. Box 513, 5600 MB Eindhoven, The Netherlands E-Mail address:

### Chapter 2 Data Storage

Chapter 2 22 CHAPTER 2. DATA STORAGE 2.1. THE MEMORY HIERARCHY 23 26 CHAPTER 2. DATA STORAGE main memory, yet is essentially random-access, with relatively small differences Figure 2.4: A typical

### MATH BOOK OF PROBLEMS SERIES. New from Pearson Custom Publishing!

MATH BOOK OF PROBLEMS SERIES New from Pearson Custom Publishing! The Math Book of Problems Series is a database of math problems for the following courses: Pre-algebra Algebra Pre-calculus Calculus Statistics

### Chapter 3. if 2 a i then location: = i. Page 40

Chapter 3 1. Describe an algorithm that takes a list of n integers a 1,a 2,,a n and finds the number of integers each greater than five in the list. Ans: procedure greaterthanfive(a 1,,a n : integers)

### FACTORING SPARSE POLYNOMIALS

FACTORING SPARSE POLYNOMIALS Theorem 1 (Schinzel): Let r be a positive integer, and fix non-zero integers a 0,..., a r. Let F (x 1,..., x r ) = a r x r + + a 1 x 1 + a 0. Then there exist finite sets S

### Chapter 11 Number Theory

Chapter 11 Number Theory Number theory is one of the oldest branches of mathematics. For many years people who studied number theory delighted in its pure nature because there were few practical applications

### Primality Testing and Factorization Methods

Primality Testing and Factorization Methods Eli Howey May 27, 2014 Abstract Since the days of Euclid and Eratosthenes, mathematicians have taken a keen interest in finding the nontrivial factors of integers,

### Two Binary Algorithms for Calculating the Jacobi Symbol and a Fast Systolic Implementation in Hardware

Two Binary Algorithms for Calculating the Jacobi Symbol and a Fast Systolic Implementation in Hardware George Purdy, Carla Purdy, and Kiran Vedantam ECECS Department, University of Cincinnati, Cincinnati,

### Lecture 3: Finding integer solutions to systems of linear equations

Lecture 3: Finding integer solutions to systems of linear equations Algorithmic Number Theory (Fall 2014) Rutgers University Swastik Kopparty Scribe: Abhishek Bhrushundi 1 Overview The goal of this lecture

### Cryptography and Network Security. Prof. D. Mukhopadhyay. Department of Computer Science and Engineering. Indian Institute of Technology, Kharagpur

Cryptography and Network Security Prof. D. Mukhopadhyay Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Module No. # 01 Lecture No. # 12 Block Cipher Standards

### CHAPTER SIX IRREDUCIBILITY AND FACTORIZATION 1. BASIC DIVISIBILITY THEORY

January 10, 2010 CHAPTER SIX IRREDUCIBILITY AND FACTORIZATION 1. BASIC DIVISIBILITY THEORY The set of polynomials over a field F is a ring, whose structure shares with the ring of integers many characteristics.

### Multiplication. Year 1 multiply with concrete objects, arrays and pictorial representations

Year 1 multiply with concrete objects, arrays and pictorial representations Children will experience equal groups of objects and will count in 2s and 10s and begin to count in 5s. They will work on practical

### The Sieve Re-Imagined: Integer Factorization Methods

The Sieve Re-Imagined: Integer Factorization Methods by Jennifer Smith A research paper presented to the University of Waterloo in partial fulfillment of the requirement for the degree of Master of Mathematics

### Just the Factors, Ma am

1 Introduction Just the Factors, Ma am The purpose of this note is to find and study a method for determining and counting all the positive integer divisors of a positive integer Let N be a given positive

### Consequently, for the remainder of this discussion we will assume that a is a quadratic residue mod p.

Computing square roots mod p We now have very effective ways to determine whether the quadratic congruence x a (mod p), p an odd prime, is solvable. What we need to complete this discussion is an effective

### 5-4 Prime and Composite Numbers

5-4 Prime and Composite Numbers Prime and Composite Numbers Prime Factorization Number of Divisorss Determining if a Number is Prime More About Primes Prime and Composite Numbers Students should recognizee

### Computer and Network Security

MIT 6.857 Computer and Networ Security Class Notes 1 File: http://theory.lcs.mit.edu/ rivest/notes/notes.pdf Revision: December 2, 2002 Computer and Networ Security MIT 6.857 Class Notes by Ronald L. Rivest

### Primes. Name Period Number Theory

Primes Name Period A Prime Number is a whole number whose only factors are 1 and itself. To find all of the prime numbers between 1 and 100, complete the following exercise: 1. Cross out 1 by Shading in

### Thnkwell s Homeschool Precalculus Course Lesson Plan: 36 weeks

Thnkwell s Homeschool Precalculus Course Lesson Plan: 36 weeks Welcome to Thinkwell s Homeschool Precalculus! We re thrilled that you ve decided to make us part of your homeschool curriculum. This lesson

### arxiv:1112.0829v1 [math.pr] 5 Dec 2011

How Not to Win a Million Dollars: A Counterexample to a Conjecture of L. Breiman Thomas P. Hayes arxiv:1112.0829v1 [math.pr] 5 Dec 2011 Abstract Consider a gambling game in which we are allowed to repeatedly

### Problem Set 7 - Fall 2008 Due Tuesday, Oct. 28 at 1:00

18.781 Problem Set 7 - Fall 2008 Due Tuesday, Oct. 28 at 1:00 Throughout this assignment, f(x) always denotes a polynomial with integer coefficients. 1. (a) Show that e 32 (3) = 8, and write down a list

### MATH 10034 Fundamental Mathematics IV

MATH 0034 Fundamental Mathematics IV http://www.math.kent.edu/ebooks/0034/funmath4.pdf Department of Mathematical Sciences Kent State University January 2, 2009 ii Contents To the Instructor v Polynomials.

### Lecture 13: Factoring Integers

CS 880: Quantum Information Processing 0/4/0 Lecture 3: Factoring Integers Instructor: Dieter van Melkebeek Scribe: Mark Wellons In this lecture, we review order finding and use this to develop a method

### Some facts about polynomials modulo m (Full proof of the Fingerprinting Theorem)

Some facts about polynomials modulo m (Full proof of the Fingerprinting Theorem) In order to understand the details of the Fingerprinting Theorem on fingerprints of different texts from Chapter 19 of the

### Information Theory and Coding Prof. S. N. Merchant Department of Electrical Engineering Indian Institute of Technology, Bombay

Information Theory and Coding Prof. S. N. Merchant Department of Electrical Engineering Indian Institute of Technology, Bombay Lecture - 17 Shannon-Fano-Elias Coding and Introduction to Arithmetic Coding

### College Algebra. Barnett, Raymond A., Michael R. Ziegler, and Karl E. Byleen. College Algebra, 8th edition, McGraw-Hill, 2008, ISBN: 978-0-07-286738-1

College Algebra Course Text Barnett, Raymond A., Michael R. Ziegler, and Karl E. Byleen. College Algebra, 8th edition, McGraw-Hill, 2008, ISBN: 978-0-07-286738-1 Course Description This course provides

### THE NAS KERNEL BENCHMARK PROGRAM

THE NAS KERNEL BENCHMARK PROGRAM David H. Bailey and John T. Barton Numerical Aerodynamic Simulations Systems Division NASA Ames Research Center June 13, 1986 SUMMARY A benchmark test program that measures

### RN-Codings: New Insights and Some Applications

RN-Codings: New Insights and Some Applications Abstract During any composite computation there is a constant need for rounding intermediate results before they can participate in further processing. Recently

### A Comparative Study of the Pickup Method and its Variations Using a Simulated Hotel Reservation Data

A Comparative Study of the Pickup Method and its Variations Using a Simulated Hotel Reservation Data Athanasius Zakhary, Neamat El Gayar Faculty of Computers and Information Cairo University, Giza, Egypt

### Is n a Prime Number? Manindra Agrawal. March 27, 2006, Delft. IIT Kanpur

Is n a Prime Number? Manindra Agrawal IIT Kanpur March 27, 2006, Delft Manindra Agrawal (IIT Kanpur) Is n a Prime Number? March 27, 2006, Delft 1 / 47 Overview 1 The Problem 2 Two Simple, and Slow, Methods

### MTH304: Honors Algebra II

MTH304: Honors Algebra II This course builds upon algebraic concepts covered in Algebra. Students extend their knowledge and understanding by solving open-ended problems and thinking critically. Topics

### Grade 7/8 Math Circles Fall 2012 Factors and Primes

1 University of Waterloo Faculty of Mathematics Centre for Education in Mathematics and Computing Grade 7/8 Math Circles Fall 2012 Factors and Primes Factors Definition: A factor of a number is a whole

### On Generalized Fermat Numbers 3 2n +1

Applied Mathematics & Information Sciences 4(3) (010), 307 313 An International Journal c 010 Dixie W Publishing Corporation, U. S. A. On Generalized Fermat Numbers 3 n +1 Amin Witno Department of Basic

### Recent Breakthrough in Primality Testing

Nonlinear Analysis: Modelling and Control, 2004, Vol. 9, No. 2, 171 184 Recent Breakthrough in Primality Testing R. Šleževičienė, J. Steuding, S. Turskienė Department of Computer Science, Faculty of Physics