Primes and Factorization

Similar documents
Math in the News: Mersenne Primes

Here is another characterization of prime numbers.

Chapter 9 Mathematics of Cryptography Part III: Primes and Related Congruence Equations

Discrete Structures Lecture Primes and Greatest Common Divisor

Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry. Spring 2006

Prime and Perfect Numbers

God may not play dice with the universe, but something strange is going on with the prime numbers.

The New Largest Known Prime is 2 p 1 With p = Who Cares? Sam Wagstaff Computer Sciences and Mathematics.

Elementary Number Theory

ECEN 5022 Cryptography

7. Prime Numbers Part VI of PJE

Algorithmic number theory. Questions/Complaints About Homework? The division algorithm. Division

Primality Testing. 1 Introduction. 2 Brief Chronology of Primality Testing. CS265/CME309, Fall Instructor: Gregory Valiant

Factorization & Primality Testing

Lecture 31: Miller Rabin Test. Miller Rabin Test

Chapter 6 Randomization Algorithm Theory WS 2012/13 Fabian Kuhn

Primes. Rational, Gaussian, Industrial Strength, etc. Robert Campbell 11/29/2010 1

Algorithms (II) Yu Yu. Shanghai Jiaotong University

Cryptography CS 555. Topic 18: RSA Implementation and Security. CS555 Topic 18 1

An integer p is prime if p > 1 and p has exactly two positive divisors, 1 and p.

With Question/Answer Animations. Chapter 4

1. Algebra 1.7. Prime numbers

Intermediate Math Circles March 6, 2013 Number Theory I

PRIME NUMBERS YANKI LEKILI

Integer and Polynomial Arithmetic First Steps towards Abstract Algebra. Arjeh M. Cohen Hans Cuypers Hans Sterk

PRIMALITY TESTING. Professor : Mr. Mohammad Amin Shokrollahi Assistant : Mahdi Cheraghchi. By TAHIRI JOUTI Kamal

Lecture 6: Cryptanalysis of public-key algorithms.,

Great Theoretical Ideas in Computer Science

Corollary 4.2 (Pepin s Test, 1877). Let F k = 2 2k + 1, the kth Fermat number, where k 1. Then F k is prime iff 3 F k 1

CHAPTER 1 REAL NUMBERS KEY POINTS

Prime Number Theory and the Riemann Zeta-Function

Prime Numbers. Prime Numbers. Ramesh Sreekantan ISI, Bangalore. December 1, 2014

. As the binomial coefficients are integers we have that. 2 n(n 1).

Primality Testing SURFACE. Syracuse University. Per Brinch Hansen Syracuse University, School of Computer and Information Science,

Calculus II : Prime suspect

CHAPTER 6. Prime Numbers. Definition and Fundamental Results

Math 412: Number Theory Lecture 3: Prime Decomposition of

Chapter 7 Randomization Algorithm Theory WS 2017/18 Fabian Kuhn

Instructor: Bobby Kleinberg Lecture Notes, 25 April The Miller-Rabin Randomized Primality Test

Introduction Integers. Discrete Mathematics Andrei Bulatov

Applied Cryptography and Computer Security CSE 664 Spring 2018

Primality testing: then and now

Before we talk about prime numbers, we will spend some time with divisibility because there is

Heuristics for Prime Statistics Brown Univ. Feb. 11, K. Conrad, UConn

[Part 2] Asymmetric-Key Encipherment. Chapter 9. Mathematics of Cryptography. Objectives. Contents. Objectives

PRIMES is in P. Manindra Agrawal. NUS Singapore / IIT Kanpur

Fermat s Little Theorem. Fermat s little theorem is a statement about primes that nearly characterizes them.

LECTURE 5: APPLICATIONS TO CRYPTOGRAPHY AND COMPUTATIONS

THE FORMATION OF PRIME NUMBERS THE SOLUTION FOR GOLDBACH S CONJECTURES

7.2 Applications of Euler s and Fermat s Theorem.

THE SOLOVAY STRASSEN TEST

Arithmetic, Algebra, Number Theory

Math 5330 Spring Notes Prime Numbers

MATH 2112/CSCI 2112, Discrete Structures I Winter 2007 Toby Kenney Homework Sheet 5 Hints & Model Solutions

not to be republished NCERT REAL NUMBERS CHAPTER 1 (A) Main Concepts and Results

Primality Testing- Is Randomization worth Practicing?

Elementary factoring algorithms

Introduction to Number Theory

Commutative Rings and Fields

1 The Fundamental Theorem of Arithmetic. A positive integer N has a unique prime power decomposition. Primality Testing. and. Integer Factorisation

8 Primes and Modular Arithmetic

An Algorithm for Prime Factorization

Cryptography: Joining the RSA Cryptosystem

10 Problem 1. The following assertions may be true or false, depending on the choice of the integers a, b 0. a "

Correctness, Security and Efficiency of RSA

History of Mathematics

Math 319 Problem Set #2 Solution 14 February 2002

4 Number Theory and Cryptography

CSCI3390-Lecture 16: Probabilistic Algorithms: Number Theory and Cryptography

Lecture notes: Algorithms for integers, polynomials (Thorsten Theobald)

Cryptography. Number Theory with AN INTRODUCTION TO. James S. Kraft. Lawrence C. Washington. CRC Press

conp = { L L NP } (1) This problem is essentially the same as SAT because a formula is not satisfiable if and only if its negation is a tautology.

REAL NUMBERS. Any positive integer a can be divided by another positive integer b in such a way that it leaves a remainder r that is smaller than b.

5.1. EXAMPLE 1 Decide whether the first number listed is divisible by the second. (a) 45; 9

Definition 6.1 (p.277) A positive integer n is prime when n > 1 and the only positive divisors are 1 and n. Alternatively

Primality testing: then and now

COMP239: Mathematics for Computer Science II. Prof. Chadi Assi EV7.635

MATHEMATICS 6180, SPRING 2017 SOME MOTIVATIONAL PROBLEMS IN NUMBER THEORY. p k

NUMBER THEORY. Anwitaman DATTA SCSE, NTU Singapore CX4024. CRYPTOGRAPHY & NETWORK SECURITY 2018, Anwitaman DATTA

You separate binary numbers into columns in a similar fashion. 2 5 = 32

Disproof MAT231. Fall Transition to Higher Mathematics. MAT231 (Transition to Higher Math) Disproof Fall / 16

Industrial Strength Factorization. Lawren Smithline Cornell University

Part II. Number Theory. Year

OBTAINING SQUARES FROM THE PRODUCTS OF NON-SQUARE INTEGERS

Some mysteries of multiplication, and how to generate random factored integers

Homework 3, solutions

MASTERARBEIT / MASTER S THESIS

SQUARE PATTERNS AND INFINITUDE OF PRIMES

Randomness. What next?

CPSC 467b: Cryptography and Computer Security

3.4. ZEROS OF POLYNOMIAL FUNCTIONS

WXML Final Report: AKS Primality Test

Divisibility of Natural Numbers

Appendix: a brief history of numbers

Sifting the Primes. Gihan Marasingha University of Oxford

The 98th Mathematics Colloquium Prague November 8, Random number theory. Carl Pomerance, Dartmouth College

The Riemann Hypothesis

cse 311: foundations of computing Fall 2015 Lecture 12: Primes, GCD, applications

Shor s Algorithm. Elisa Bäumer, Jan-Grimo Sobez, Stefan Tessarini May 15, 2015

CLASS-IX MATHEMATICS. For. Pre-Foundation Course CAREER POINT

Transcription:

Primes and Factorization 1

A prime number is an integer greater than 1 with no proper divisors. The list begins 2, 3, 5, 7, 11, 13, 19,... See http://primes.utm.edu/ for a wealth of information about primes. 2

Primes can be found via the Sieve of Eratosthenes. In the following array, striking out all multiples of 2, 3, 5, 7, 11, 13, and 17 leaves all primes from 2 up to 300. 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 3

Reason: At each step, the next number not struck out has no prime divisor smaller than it is; it must therefore be prime. There is no need to look at prime factors beyond 17 because bracket 300. 17 2 = 189 and 19 2 = 361

The list goes on and on, though there are arbitrarily large gaps between primes E.g., there are no primes in the range 100! + 2, 100! + 3, 100! + 4,...,100! + 100 because these numbers are, respectively, divisible by 2, 3,...,99, 100 4

Gaps between successive primes gap from prime n to prime n+1 30 25 20 15 10 5 200 400 600 800 1000 n 5

Density of Primes With π(n) = number of primes less than or equal to n the following graph shows 0.5 0.4 0.3 0.2 π(n)/n y = π(n) 0.1 n for 2 n 500 100 200 300 400 500 n 6

Prime density compared with 1 ln n y 0.5 0.4 y = π(n)/n y = 1/ln(n) 0.3 0.2 0.1 100 200 300 400 500 n Prime number theorem π(n) n 1 ln n for large n 7

Legendre (1798) and Gauss (1793) suggested the result. 8

Hadamard and de la Vallée Poussin proved the results. Landau (1903) simplified the proof, and Erdös and Selberg (1949) gave a purely number theoretic proof. 9

Example Approximately how many primes are there in the range from 1 to a google? 10

Solution 1google = 10 100 By the Prime Number Theorem, π(10 100 ) 10 00 ln(10 100 ) = 10100 100 ln 10 = 1098 2.303 = 4.343 10 97 11

Prime Determination Example Is 12997 prime? 12

Solution If 12997 is composite, then 12997 = k m, then k and m cannot both be greater than 12997 = 114.004. Consequently, trial division by 2, 3, 5, 7, 11,... up to this number will either result in a zero remainder, in which case the number is composite, or, result in non-zero remainders for all these divisions, in which case 12997 has no proper factors and is therefore prime. 13

12997 = 6498 2+1 12997 = 4332 3+1. 12997 = 351 37+10 12997 = 317 41+0 Thus with a relatively small number of divisions, we know that 12997 is composite. 14

General trial division procedure: to test n for primeness, find n and divide by primes in the range 2 to n until either a zero remainder occurs or until n has been divided by all of these primes without a zero remainder. 15

Probabilistic Primality Testing Large prime numbers, such as n = 289103300313358575630522639894 005983329289146232128397829437 586866804375605142401296930897 are raw material for some public-key cryptographic methods. 16

Given a number such as N = 5218535468487849978594641869670373 6539757078706623666601849635119766 1954904176769218162995066881596232 6620565977174648322299914018221445 5994353753508805331228808282977416 856057519461006078310026218937 how do we test for primeness? 17

N 7.22 10 99 so trial division by all the integers from 2 to 7.22 10 99 would take roughly this many arithmetic steps. If a computer can perform 1 division in one billionth of a second (10 9 sec), then these computations would take 10 9 7.22 10 99 =7.22 10 90 sec = 2.29 10 92 yr, which is many orders of magnitude larger than the expected life of the universe. 18

A probabilistic prime test algorithm, such as the Miller-Rabin Test is used to show that the probability N is prime is very close to 1. 19

There is an algorithm for determining whether a positive integer with x binary digits is prime whose time comlexity is O(x 7.5 ). This was shown by Agrawal, Kayal, and Saxena in 2002. Thus prime testing is a polynomial time problem. 20

Largest Known Primes See http://www.utm.edu/research/primes 2 13466917 1 is the largest known prime as of 2003. It was discovered by Michael Cameron, George Woltman, Scott Kurowski, et al. in 2001 as part of GIMPS. It is a Mersenne prime, one of the form 2 p 1, where p is prime. It has 13466917 digits in its binary representation, and 13466917 ln(2)/ ln(10) + 1 = 4053946 digits in its decimal representation. 21

Infinitude of Primes In c. 500 B.C., Euclid proved that there are infinitely many primes. Euclid s proof: Suppose, to the contrary, that there are finitely many primes, 2, 3, 5, 7,...,P, where P is the last prime. Then are all composite. P +1,P +2,P +3,... But consider the number N =(2 3 5 7 P )+1 22

This number is not divisible by 2, 3, 5,..., P (remainder is 1 in each case), so by the Fundamental Theorem of Arithmetic, N must itself be prime. However, N is bigger than P, which means N must be composite. This contradiction shows that the assumption of a last prime P was wrong: there is no last prime; there are infinitely many primes. 23

Other interesting number theory research In August 2002, Agrawal, Kayal, and Saxena discovered a polynomial time algorithm for determining whether a given integer is prime. See http://www.cse.iitk.ac.in/news/primality.html 24

Factoring FTA: Every positive integer is factorable into a product of powers of primes. Apart from the order of the factors, the factorization is unique. E.g., 286706200 = 2 3 5 2 11 19 4 as you can check by multiplying the numbers of the right-hand side. The prime checking procedure can be extended to a sure-fire if inefficient method of factoring an integer n. 25

Trial division factorization of an integer n For each prime p in the range 2 to n, check if n MOD p is 0. If YES, then n = p m; test m for divisibility by p in the same way until a non-zero remainder occurs. The number of times a zero remainder occurs is the power of p contained in n. if NO, then go on to the next prime. 26

Faster Factorization Algorithms Pollard p 1 method Quadratic Sieve Other fast algorithms exist, but none is known that in general factors integers in polynomial time of the size of the integer. That is, factoring in general is believed to be inherently a time-consuming process. Consequence: If two distinct large (say 100 digits in the decimal representation) primes p and q are multiplied together to form n, then an individual presented with the product n will have a low probability of factoring the number to recover p and q in a reasonable amount of time. 27