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