Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Prime and Composite Numbers MATH 100 Survey of Mathematical Ideas J. Robert Buchanan Department of Mathematics Fall 2014 J. Robert Buchanan Prime and Composite Numbers Number Theory Number theory is a branch of mathematics devoted to the study of properties of the natural numbers. J. Robert Buchanan Prime and Composite Numbers Number Theory Number theory is a branch of mathematics devoted to the study of properties of the natural numbers. Definition The natural number a is divisible by the natural number b if there exists a natural number k such that a = b k . If b divides a we write b|a. J. Robert Buchanan Prime and Composite Numbers Number Theory Number theory is a branch of mathematics devoted to the study of properties of the natural numbers. Definition The natural number a is divisible by the natural number b if there exists a natural number k such that a = b k . If b divides a we write b|a. Definition A natural number greater than 1 that has only itself and 1 as divisors is called a prime number. A natural number greater than 1 that is not prime is called composite. J. Robert Buchanan Prime and Composite Numbers Sieve of Eratosthenes (1 of 2) One method for determining if a natural number is prime. 1 List the natural numbers 2, 3, 4, . . . , N. 2 2 is prime, strike out every higher multiple of 2. 3 3 is prime, strike out every higher multiple of 3. 4 5 is prime, strike out every higher multiple of 5. 5 Keep√going until you reach the largest natural number less than N. 6 All you have left is a list of prime numbers. J. Robert Buchanan Prime and Composite Numbers Sieve of Eratosthenes (2 of 2) 1 2 3 We would like to find all the prime numbers less than 50. Start with a list of natural numbers 2, 3, . . . , 50. √ Use the sieve procedure up to 50 ≈ 7. 11 21 31 41 2 12 22 32 42 3 13 23 33 43 4 14 24 34 44 5 15 25 35 45 J. Robert Buchanan 6 16 26 36 46 7 17 27 37 47 8 18 28 38 48 9 19 29 39 49 Prime and Composite Numbers 10 20 30 40 50 Sieve of Eratosthenes (2 of 2) 1 2 3 We would like to find all the prime numbers less than 50. Start with a list of natural numbers 2, 3, . . . , 50. √ Use the sieve procedure up to 50 ≈ 7. 2 11 21 31 41 3 13 23 33 43 5 15 25 35 45 J. Robert Buchanan 7 17 27 37 47 9 19 29 39 49 Prime and Composite Numbers Sieve of Eratosthenes (2 of 2) 1 2 3 We would like to find all the prime numbers less than 50. Start with a list of natural numbers 2, 3, . . . , 50. √ Use the sieve procedure up to 50 ≈ 7. 2 11 31 41 3 13 23 5 25 35 43 J. Robert Buchanan 7 17 37 47 19 29 49 Prime and Composite Numbers Sieve of Eratosthenes (2 of 2) 1 2 3 We would like to find all the prime numbers less than 50. Start with a list of natural numbers 2, 3, . . . , 50. √ Use the sieve procedure up to 50 ≈ 7. 2 11 31 41 3 13 23 5 43 J. Robert Buchanan 7 17 37 47 19 29 49 Prime and Composite Numbers Sieve of Eratosthenes (2 of 2) 1 2 3 We would like to find all the prime numbers less than 50. Start with a list of natural numbers 2, 3, . . . , 50. √ Use the sieve procedure up to 50 ≈ 7. 2 11 31 41 3 13 23 5 43 J. Robert Buchanan 7 17 19 29 37 47 Prime and Composite Numbers Sieve of Eratosthenes (2 of 2) 1 2 3 We would like to find all the prime numbers less than 50. Start with a list of natural numbers 2, 3, . . . , 50. √ Use the sieve procedure up to 50 ≈ 7. 2 11 31 41 51 61 71 81 91 52 62 72 82 92 5 3 13 23 43 53 63 73 83 93 17 54 64 74 84 94 55 65 75 85 95 56 66 76 86 96 37 47 57 67 77 87 97 19 29 58 68 78 88 98 59 69 79 89 99 60 70 80 90 100 Now find the prime numbers less than 100. Use your i>clicker2 to submit the count of prime numbers less than 100. J. Robert Buchanan Prime and Composite Numbers Divisibility Tests Divisible by 2 3 4 5 6 8 9 10 12 Test Last digit is 0, 2, 4, 6, or 8. Sum of the digits is divisible by 3. Last two digits form a number divisible by 4. Last digit is 0 or 5. Number is divisible by 2 and 3. Last three digits form a number divisible by 8. Sum of the digits is divisible by 9. Last digit is 0. Number is divisible by 4 and 3. J. Robert Buchanan Prime and Composite Numbers Example Consider the number 45815. Determine if it is divisible by n 2 3 4 5 6 8 9 10 12 (n | 45815)? J. Robert Buchanan Prime and Composite Numbers Example Consider the number 45815. Determine if it is divisible by n 2 3 4 5 6 8 9 10 12 (n | 45815)? No No No No No No J. Robert Buchanan Prime and Composite Numbers Example Consider the number 45815. Determine if it is divisible by n 2 3 4 5 6 8 9 10 12 (n | 45815)? No No No No No No No No J. Robert Buchanan Prime and Composite Numbers Example Consider the number 45815. Determine if it is divisible by n 2 3 4 5 6 8 9 10 12 (n | 45815)? No No No Yes No No No No No J. Robert Buchanan Prime and Composite Numbers Leap Years A leap year is a year which is divisible by 4 but not by 100 except if it is divisible by 400. Leap Years 2012 2000 2104 1532 2224 J. Robert Buchanan Not Leap Years 2014 1800 2106 1500 2222 Prime and Composite Numbers Leap Years A leap year is a year which is divisible by 4 but not by 100 except if it is divisible by 400. Which if the following years is/was/will be a leap year? Use your i>clicker2 to select “A” for leap year and “B” for not a leap year. 1780 J. Robert Buchanan Prime and Composite Numbers Leap Years A leap year is a year which is divisible by 4 but not by 100 except if it is divisible by 400. Which if the following years is/was/will be a leap year? Use your i>clicker2 to select “A” for leap year and “B” for not a leap year. 1780 1900 J. Robert Buchanan Prime and Composite Numbers Leap Years A leap year is a year which is divisible by 4 but not by 100 except if it is divisible by 400. Which if the following years is/was/will be a leap year? Use your i>clicker2 to select “A” for leap year and “B” for not a leap year. 1780 1900 2002 J. Robert Buchanan Prime and Composite Numbers Leap Years A leap year is a year which is divisible by 4 but not by 100 except if it is divisible by 400. Which if the following years is/was/will be a leap year? Use your i>clicker2 to select “A” for leap year and “B” for not a leap year. 1780 1900 2002 2100 J. Robert Buchanan Prime and Composite Numbers Leap Years A leap year is a year which is divisible by 4 but not by 100 except if it is divisible by 400. Which if the following years is/was/will be a leap year? Use your i>clicker2 to select “A” for leap year and “B” for not a leap year. 1780 1900 2002 2100 2400 J. Robert Buchanan Prime and Composite Numbers Fundamental Theorem of Arithmetic Every natural number can be expressed in one and only one way as a product of primes (if the order of the factors is disregarded). This unique product of primes is called the prime factorization of the natural number. J. Robert Buchanan Prime and Composite Numbers Fundamental Theorem of Arithmetic Every natural number can be expressed in one and only one way as a product of primes (if the order of the factors is disregarded). This unique product of primes is called the prime factorization of the natural number. Example Find the prime factorization of 885. J. Robert Buchanan Prime and Composite Numbers Fundamental Theorem of Arithmetic Every natural number can be expressed in one and only one way as a product of primes (if the order of the factors is disregarded). This unique product of primes is called the prime factorization of the natural number. Example Find the prime factorization of 885. 885 = 3 · 5 · 59 J. Robert Buchanan Prime and Composite Numbers How Many Numbers Divide N? To determine the number of divisors of N: 1 Write N as a product of prime factors using exponents. 2 Add 1 to each exponent. 3 Multiply these augmented exponents. J. Robert Buchanan Prime and Composite Numbers How Many Numbers Divide N? To determine the number of divisors of N: 1 Write N as a product of prime factors using exponents. 2 Add 1 to each exponent. 3 Multiply these augmented exponents. Example How many numbers divide 308? J. Robert Buchanan Prime and Composite Numbers How Many Numbers Divide N? To determine the number of divisors of N: 1 Write N as a product of prime factors using exponents. 2 Add 1 to each exponent. 3 Multiply these augmented exponents. Example How many numbers divide 308? 308 = 22 · 7 · 11 = 22 · 71 · 111 Number of divisors = (2 + 1)(1 + 1)(1 + 1) = (3)(2)(2) = 12 J. Robert Buchanan Prime and Composite Numbers How Many Numbers Divide 456? 456 = 23 · 31 · 191 J. Robert Buchanan Prime and Composite Numbers How Many Numbers Divide 456? 456 = 23 · 31 · 191 Number of divisors = (3 + 1)(1 + 1)(1 + 1) = (4)(2)(2) = 16 J. Robert Buchanan Prime and Composite Numbers Examples Find the number of divisors of the following and submit that number using your i>clicker2: 2520 J. Robert Buchanan Prime and Composite Numbers Examples Find the number of divisors of the following and submit that number using your i>clicker2: 2520 4050 J. Robert Buchanan Prime and Composite Numbers Infinitude of the Primes Theorem There are infinitely many prime numbers. J. Robert Buchanan Prime and Composite Numbers Infinitude of the Primes Theorem There are infinitely many prime numbers. Proof. Suppose there were only finitely many primes, p1 , p2 , . . . , pn . Form the number N = (p1 · p2 · · · pn ) + 1 N > pi for i = 1, 2, . . . , n but pi does not divide N. N is either prime or there is another prime (not in the original list) which divides N. J. Robert Buchanan Prime and Composite Numbers Searching for Prime Numbers Large prime numbers are useful in cryptography. Definition For n = 1, 2, 3, . . ., the Mersenne numbers are those generated by the formula Mn = 2n − 1. 1 If n is composite, then Mn is also composite. 2 If n is prime, then Mn may be prime or composite. The prime values of Mn are called the Mersenne primes. J. Robert Buchanan Prime and Composite Numbers Some Mersenne Numbers n 2 3 5 13 29 67 Mn 3 7 31 8,191 536,870,911 147,573,952,589,676,412,927 Prime? Prime Prime Prime Prime Composite Composite In 2014 the largest known Mersenne prime number is 257885161 − 1 ≈ 5.818872662322464 × 1017425169 which has 17, 425, 170 digits. It was discovered January 25, 2013 (only the 48th Mersenne prime ever found). J. Robert Buchanan Prime and Composite Numbers Fermat Numbers Pierre de Fermat (1601–1665) conjectured that the formula n Fn = 22 + 1 would always produce a prime number. He checked n = 0, 1, 2, 3, 4. J. Robert Buchanan Prime and Composite Numbers Fermat Numbers Pierre de Fermat (1601–1665) conjectured that the formula n Fn = 22 + 1 would always produce a prime number. He checked n = 0, 1, 2, 3, 4. n 0 1 2 3 4 5 Fn 3 5 17 257 65537 4294967297 J. Robert Buchanan Prime? Prime and Composite Numbers Fermat Numbers Pierre de Fermat (1601–1665) conjectured that the formula n Fn = 22 + 1 would always produce a prime number. He checked n = 0, 1, 2, 3, 4. n 0 1 2 3 4 5 Fn 3 5 17 257 65537 4294967297 J. Robert Buchanan Prime? Yes Yes Yes Yes Yes Prime and Composite Numbers Fermat Numbers Pierre de Fermat (1601–1665) conjectured that the formula n Fn = 22 + 1 would always produce a prime number. He checked n = 0, 1, 2, 3, 4. n 0 1 2 3 4 5 Fn 3 5 17 257 65537 4294967297 J. Robert Buchanan Prime? Yes Yes Yes Yes Yes (641)(6700417) Prime and Composite Numbers Euler’s Formula Leonhard Euler noted in 1732 that the formula p(n) = n2 − n + 41 always produces a prime number for 1 ≤ n < 41, but is composite when n = 41. n 1 5 9 13 .. . p(n) 41 61 113 197 .. . n 2 6 10 14 .. . p(n) 43 71 131 223 .. . n 3 7 11 15 .. . p(n) 47 83 151 251 .. . n 4 8 12 16 .. . p(n) 53 97 173 281 .. . 37 1373 38 1447 39 1523 40 1601 J. Robert Buchanan Prime and Composite Numbers Escott’s Formula E.B. Escott offered in 1879 the formula q(n) = n2 − 79n + 1601 which always produces a prime number for 1 ≤ n < 80, but is composite when n = 80. n 1 5 9 13 .. . q(n) 1523 1231 971 743 .. . n 2 6 10 14 .. . q(n) 1447 1163 911 691 .. . n 3 7 11 15 .. . q(n) 1373 1097 853 641 .. . n 4 8 12 16 .. . q(n) 1301 1033 797 593 .. . 76 1373 77 1447 78 1523 79 1601 J. Robert Buchanan Prime and Composite Numbers