Primes Rational, Gaussian, Industrial Strength, etc Robert Campbell 11/29/2010 1
Primes and Theory Number Theory to Abstract Algebra History Euclid to Wiles Computation pencil to supercomputer Practical Uses Cryptography, Error Correcting Codes, etc 11/29/2010 2
Everybody Knows Everybody knows what a prime is: 2, 3, 5, 7, 9, 11, p is prime if its only positive divisors are 1 and p p is prime if, whenever p divides ab, then either p divides a and/or p divides b Any number N factors into a product of primes uniquely (up to order) 11/29/2010 3
Primal Questions Definition Counting Finding and Identifying 11/29/2010 4
Definition(s) Definition: p is prime irreducible if its only if its positive only positive divisors divisors are 1 are and 1 pand p p is prime if, whenever p divides ab, then either p divides a and/or p divides b Thm: If p is prime then p is irreducible Let a be a divisor of p, so p=ab for some b Then p divides a and/or p divides b (as p is prime) Case 1: p divides a. So a=pc, hence a=abc, so 1=bc and b=1. Thus a = p. Case 2: p divides b. Similar argument - thus b = p and a = 1 Thm: If p is irreducible then p is prime Proof requires division algorithm Euclidean Algorithm 11/29/2010 5
Division & Euclidean Algorithms Division Algorithm/Property Given positive integers a and b there are integers r and q with a = bq + r and 0 r < b Euclidean Algorithm Given a and b, compute their greatest common divisor (efficiently) 11/29/2010 6
Euclidean Algorithm (II) Example - Compute gcd of 120 and 222: 120 222 120 222-120=102 120-102=18 102 18 102-5*18=12 18-12=6 12 6 12-2*6=0 11/29/2010 7
Finding Primes Sieve of Eratosthenes 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 Primes: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31 11/29/2010 8
Counting Primes There are an infinite number of prime numbers. Proof: Assume not. So p 1,, p n is a list of all primes. Then construct N = p 1 p n +1 and note that none of the known primes divides it. Thus N is prime we have a contradiction. Thus our assumption is incorrect there are infinite primes. Can we do better? 11/29/2010 9
Counting Primes (II) π(x) := The number of primes no greater than x π(10) = #{2, 3, 5, 7} = 4 π(20) = #{2, 3, 5, 7, 11, 13, 17, 19} = 8 π(100) = 25; π(1000) = 168; π(10000) = 1229; π(100000) = 9592; Prime Number Theorem (Conjecture) The number of primes less than x is approximately x/log(x) 11/29/2010 10
Counting Primes (III) Conjectured Gauss (1791? First published 1863) Legendre (1798) Proven Hadamard (1896) de la Vallée Poussin (1896) Further work Riemann Hypothesis 11/29/2010 11
Identifying Primes Proofs Given a number prove that it is prime Tests Industrial Strength Primes 11/29/2010 12
Identifying Primes (II) [Fermat s Little Theorem] If p is prime and p does not divide a, then p divides (a p a) Proof: [Simple, but not today] 35 is not prime as: Let p = 35 and a = 2 Compute (2 35 2) = 34359738366 Note that 35 does not divide 34359738366 17 might be prime as: Let p = 17 and a = 3 Compute (3 17 3) = 129140160 Note that 17 divides 129140160 (in fact 129140160 = (17)(7596480)) 11/29/2010 13
Efficiency Questions Modular Arithmetic & Russian Peasants Even/Odd Arithmetic: + Even Odd * Even Odd Even Even Odd Even Even Even Odd Odd Even Odd Even Odd Modular (Residue) Arithmetic: [Example: Mod 5] + 0 1 2 3 4 * 0 1 2 3 4 0 0 1 2 3 4 0 0 0 0 0 0 1 1 2 3 4 0 1 0 1 2 3 4 2 2 3 4 0 1 2 0 2 4 1 3 3 3 4 0 1 2 3 0 3 1 4 2 4 4 0 1 2 3 4 0 4 3 2 1 11/29/2010 14
Identifying Primes (III) 101 might be prime as: Let p = 101 and a = 2 Compute 2 101 (mod 101) 2 1 = 2 2 2 = (2 1 ) 2 = 4 2 4 = (2 2 ) 2 = 4 2 = 16 2 8 = (2 4 ) 2 = 16 2 = 256 = 54 (mod 101) 2 16 = (2 8 ) 2 = 54 2 = 2916 = 88 (mod 101) 2 32 = (2 16 ) 2 = 88 2 = 7744 = 68 (mod 101) 2 64 = (2 32 ) 2 = 68 2 = 4624 = 79 (mod 101) 2 101 = 2 64+32+4+1 = (2 64 )(2 32 )(2 4 )(2 1 )=(79)(68)(16)(2)=171904 = 2 (mod 101) Try this for 5446367 But try this for 561 11/29/2010 15
Open Questions Find integers a, b, c and n>2 with a n + b n = c n (FLT) Any even integer greater than 2 is the sum of two primes (Goldbach) [e.g. 36 = 29 + 7] Are there an infinite number of successive odd numbers which are prime? (Twin Prime) [e.g. {3,5}, {5,7},, {281, 283}, ] Is there a prime of the form p = 2 2n + 1 for n>4? (Fermat Prime) [e.g. F3 = 2 23 + 1 = 257] 11/29/2010 16
Extension: Gaussian Integers Consider the complex numbers with integer coefficients: {n + mi} = Z[-1] All the nice properties hold: There are an infinite number of irreducibles: 3, 1 i, 7, 2 i, Unique factorization into irreducibles (up to order and multiples of i and 1) We can sieve to find primes We can test for primality 11/29/2010 17
A GI Eratosieve i -1 0 1 -i 1 i 2 I, 1 2i 3, 3i 3 2i, 2 3i, 11/29/2010 18
Identifying GI Primes Given a prime p, can we test to see if it is prime? Fermat s Little Thm (extended to Gaussian Integers) If p is a Gaussian prime, and p does not divide a, then p divides (a N(p) a), where N(p) = pp* is the norm of p. Examples: (1+i) 49 (1+i) = 0 (mod 7), so 7 is probably a Gaussian prime (2+i) 13 (2+i) = 0 (mod 2+3i), so 2+3i is probably a GI prime (2+i) 34 - (2+i) = 1 + 3i (mod 5+3i), so 5+3i is not a GI prime 11/29/2010 19
A Counterexample Consider Z[-6] = {n + m -6} Find primes by sieving But The only units are 1 2, 3, -6, 1+ -6, are irreducible 6 = (-1)(-6) 2 6 = (2)(3) Factorization is not unique -6 divides 6 and 6 = (2)(3), but -6 divides neither 2 nor 3 Z[-6] has irreducibles, but no primes 11/29/2010 20
References & Further Reading The Elements, Euclid (ca 300 BC) (trans Thomas Heath), Dover Publ http://aleph0.clarku.edu/~djoyce/java/elements/elements.html Elementary Number Theory, Jones & Jones, Springer, 1998 The Book of Numbers, Conway & Guy, Copernicus, 1996 Prime Numbers, A Computational Perspective, Crandall & Pomerance, Telos Publ, 2001 Factorization and Primality Testing, Bressoud, Springer, 1989 Algebraic Number Theory and Fermat s Last Thm, 3 rd Ed, Stewart & Tall, Peters Publ, 2002 The Primes Pages http://www.utm.edu/research/primes/ Computational Number Theory http://www.math.umbc.edu/~campbell/numbthy/class/ 11/29/2010 21