Discrete Structures Lecture Primes and Greatest Common Divisor

Similar documents
Number Theory and Divisibility

The set of integers will be denoted by Z = {, -3, -2, -1, 0, 1, 2, 3, 4, }

2 Elementary number theory

Math 3336 Section 4.3 Primes and Greatest Common Divisors. Prime Numbers and their Properties Conjectures and Open Problems About Primes

4.3 - Primes and Greatest Common Divisors

Introduction to Number Theory

Arithmetic, Algebra, Number Theory

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

With Question/Answer Animations. Chapter 4

Exercises Exercises. 2. Determine whether each of these integers is prime. a) 21. b) 29. c) 71. d) 97. e) 111. f) 143. a) 19. b) 27. c) 93.

Number Theory. Number Theory. 6.1 Number Theory

4 Number Theory and Cryptography

The numbers 1, 2, 3, are called the counting numbers or natural numbers. The study of the properties of counting numbers is called number theory.

5.1. Primes, Composites, and Tests for Divisibility

a the relation arb is defined if and only if = 2 k, k

Chapter 5: The Integers

5: The Integers (An introduction to Number Theory)

Ch 4.2 Divisibility Properties

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

3 The fundamentals: Algorithms, the integers, and matrices

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

1. (16 points) Circle T if the corresponding statement is True or F if it is False.

2x 1 7. A linear congruence in modular arithmetic is an equation of the form. Why is the solution a set of integers rather than a unique integer?

CMPUT 403: Number Theory

Applied Cryptography and Computer Security CSE 664 Spring 2017

Introduction to Information Security

Proofs. Methods of Proof Divisibility Floor and Ceiling Contradiction & Contrapositive Euclidean Algorithm. Reading (Epp s textbook)

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

p = This is small enough that its primality is easily verified by trial division. A candidate prime above 1000 p of the form p U + 1 is

Primes and Factorization

Introduction Integers. Discrete Mathematics Andrei Bulatov

LARGE PRIME NUMBERS. In sum, Fermat pseudoprimes are reasonable candidates to be prime.

Here is another characterization of prime numbers.

CHAPTER 1 REAL NUMBERS KEY POINTS

CISC-102 Fall 2017 Week 6

7.2 Applications of Euler s and Fermat s Theorem.

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

Number Theory and Cryptography

Integers and Division

LP03 Chapter 5. A prime number is a natural number greater that 1 that has only itself and 1 as factors. 2, 3, 5, 7, 11, 13, 17, 19, 23, 29,

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

Course: CS1050c (Fall '03) Homework2 Solutions Instructor: Prasad Tetali TAs: Kim, Woo Young: Deeparnab Chakrabarty:

Slide 1 / 69. Slide 2 / 69. Slide 3 / 69. Whole Numbers. Table of Contents. Prime and Composite Numbers

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

2x 1 7. A linear congruence in modular arithmetic is an equation of the form. Why is the solution a set of integers rather than a unique integer?

cse547, math547 DISCRETE MATHEMATICS Professor Anita Wasilewska

Arithmetic. Integers: Any positive or negative whole number including zero

is square-free. Suppose it were not and had a square factor x 2 p r 1. This is a contradiction, as the only possible primes dividing p r 1

Lecture 7 Number Theory Euiseong Seo

Homework #2 solutions Due: June 15, 2012

Exam 2 Review Chapters 4-5

Divisibility in the Fibonacci Numbers. Stefan Erickson Colorado College January 27, 2006

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

CSE 20 DISCRETE MATH. Winter

Discrete Math. Instructor: Mike Picollelli. Day 10

OBTAINING SQUARES FROM THE PRODUCTS OF NON-SQUARE INTEGERS

Section 3-4: Least Common Multiple and Greatest Common Factor

Introduction to Sets and Logic (MATH 1190)

Discrete Mathematics GCD, LCM, RSA Algorithm

Section Summary. Division Division Algorithm Modular Arithmetic

Primality Proofs. Geoffrey Exoo Department of Mathematics and Computer Science Indiana State University Terre Haute, IN

PRIMALITY TEST FOR FERMAT NUMBERS USING QUARTIC RECURRENCE EQUATION. Predrag Terzic Podgorica, Montenegro

PRACTICE PROBLEMS: SET 1

August 15, M1 1.4 Common Factors_Multiples Compacted.notebook. Warm Up MI 36. Jun 20 10:53 AM

Math.3336: Discrete Mathematics. Primes and Greatest Common Divisors

Mathematics for Computer Science Exercises for Week 10

Notes on Systems of Linear Congruences

MATH 4400 SOLUTIONS TO SOME EXERCISES. 1. Chapter 1

Number Theory. CSS322: Security and Cryptography. Sirindhorn International Institute of Technology Thammasat University CSS322. Number Theory.

LARGE PRIME NUMBERS (32, 42; 4) (32, 24; 2) (32, 20; 1) ( 105, 20; 0).

Numbers. Çetin Kaya Koç Winter / 18

Outline. Some Review: Divisors. Common Divisors. Primes and Factors. b divides a (or b is a divisor of a) if a = mb for some m

Outline. AIT 682: Network and Systems Security. GCD and Euclid s Algorithm Modulo Arithmetic Modular Exponentiation Discrete Logarithms

4 Powers of an Element; Cyclic Groups

NOTES ON SIMPLE NUMBER THEORY

n = p 1 p 2 p r = q 1 q 2 q m, then r = m (i.e. the number of primes in any prime decomposition

MATH 501 Discrete Mathematics. Lecture 6: Number theory. German University Cairo, Department of Media Engineering and Technology.

Associative property

Math Circle Beginners Group February 28, 2016 Euclid and Prime Numbers Solutions

Homework 3, solutions

CSC 474 Network Security. Outline. GCD and Euclid s Algorithm. GCD and Euclid s Algorithm Modulo Arithmetic Modular Exponentiation Discrete Logarithms

SEVENTH EDITION and EXPANDED SEVENTH EDITION

Lecture 7: Number Theory Steven Skiena. skiena

Math 110 FOUNDATIONS OF THE REAL NUMBER SYSTEM FOR ELEMENTARY AND MIDDLE SCHOOL TEACHERS

1/19 2/25 3/8 4/23 5/24 6/11 Total/110 % Please do not write in the spaces above.

and LCM (a, b, c) LCM ( a, b) LCM ( b, c) LCM ( a, c)

2MA105 Algebraic Structures I

Number Theory. Zachary Friggstad. Programming Club Meeting

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

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

ENEE 457: Computer Systems Security. Lecture 5 Public Key Crypto I: Number Theory Essentials

Integer factorization, part 1: the Q sieve. D. J. Bernstein

Intermediate Math Circles March 6, 2013 Number Theory I

Topics in Cryptography. Lecture 5: Basic Number Theory

M381 Number Theory 2004 Page 1

Wednesday, February 21. Today we will begin Course Notes Chapter 5 (Number Theory).

8 Primes and Modular Arithmetic

Divisibility, Factors, and Multiples

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

Quantitative Aptitude

Transcription:

DEFINITION 1 EXAMPLE 1.1 EXAMPLE 1.2 An integer p greater than 1 is called prime if the only positive factors of p are 1 and p. A positive integer that is greater than 1 and is not prime is called composite. Determine if 7 is prime. The only integers that divide 7 are 1 and 7 and, by definition 1, 7 is prime. Determine if 9 is prime. 3 9 and, therefore, 9 is not prime but composite. THEOREM 1 THE FUNDAMENTAL THEOREM OF ARITHMETIC. Every positive integer greater than 1 can be written uniquely as a prime or the product of two or more primes where the prime factors are written in order of nondecreasing size. EXAMPLE 2.1 Find the prime factorization of 100. 100 2 2 5 5 2 5 EXAMPLE 2.2 Find the prime factorization of 641. 641 641. EXAMPLE 2.3 Find the prime factorization of 999. 999 3 3 3 37 3 37 EXAMPLE 2.4 Find the prime factorization of 1024. 1024 2 2 2 2 2 2 2 2 2 2 2 Trial Division THEOREM 2 EXAMPLE 3 If n is a composite integer, then n has a prime divisor less than or equal to. Show that 101 is prime. If we can find no prime factors of 101 less than 101 then 101 is prime. 2 101 3 101 5 101 7 101 Hence, 101 is prime. 1

EXAMPLE 4 Find the prime factorization of 7007 Factors of 7007 must be less than or equal to 7007 83. 7007 7 7 11 13 7 11 13 The Sieve of Eratosthenes Note that composite integers not exceeding 100 must have a prime factor not exceeding 10. Because the only primes less than 10 are 2, 3, 5, and 7, the primes not exceeding 100 are these four primes and those positive integers greater than 1 and not exceeding 100 that are divisible by none of 2, 3, 5, or 7. The sieve of Eratosthenes is used to find all primes not exceeding a specified positive integer. For instance, the following procedure is used to find the primes not exceeding 10. We begin with the list of all integers between 1 and 100. To begin the sieving process, the integers that are divisible by 2, other than 2, are deleted. Because 3 is the first integer greater that 2 that is left, all those integers divisible by 3, other than 3, are deleted. We continue finding primes and deleting their multiples until we have reached the square root of the maximum value. In this case the 100 10. The remaining integers are prime. Original 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 Remove multiples of 2 but not 2 itself. 1 2 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 51 53 55 57 59 61 63 65 67 69 71 73 75 77 79 81 83 85 87 89 91 93 95 97 99 2

Remove multiples of 3 but not 3 itself. 1 2 3 5 7 11 13 17 19 23 25 29 31 35 37 41 43 47 49 53 55 59 61 65 67 71 73 77 79 83 85 89 91 95 97 Remove multiples of 5 but not 5 itself. 1 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 49 53 59 61 67 71 73 77 79 83 89 91 97 Remove multiples of 7 but not 7 itself. 1 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 3

THEOREM 3 Remark There are infinitely many primes. A Mersenne prime has the form 2 1 where p is prime. Not all values of the form 2 1 are prime but there exists an efficient test, known as the Lucas Lehmer test, for determining whether 2 1 is prime. EXAMPLE 5 THEOREM 4 Find the first value of the form 2 1 that is not prime. Prime Is it a prime number 2 2 1 3 yes 3 2 1 7 yes 5 2 1 31 yes 7 2 1 127 yes 11 2 1 2047 23 89 no THE PRIME NUMBER THEOREM. The ratio of the number of primes not exceeding and ln approaches 1 as x grows without bound. (Here ln is the natural logarithm of x.) Greatest Common Divisors and Least Common Multiples DEFINITION 2 Let a and b be integers, not both zero. The largest integer d such that and is called the greatest common divisor of a and b. The greatest common divisor of a and b is denoted by gcd(a,b). EXAMPLE 10 What is the greatest common divisor of 24 and 36? 24 1, 2, 3, 4, 6, 8, 12, 24 36 1, 2, 3, 4, 6, 9, 12, 18, 36 The gcd(24,36)=12 EXAMPLE 11 What is the greatest common divisor of 17 and 22? 17 1, 17 22 1, 11, 22 The gcd(17,22)=1 DEFINITION 3 The integers a and b are relatively prime if their greatest common divisor is 1. EXAMPLE 12 Are 17 and 22 relatively prime? Yes, because gcd(17,22)=1 DEFINITION 4 The integers,,, are pairwise relatively prime if gcd(, )=1 whenever 1 4

EXAMPLE 13.1 EXAMPLE 13.2 Determine whether the integers 10, 17, and 21 are pairwise relatively prime. 10 1, 2, 5, 10 17 1, 17 21 1, 3, 7, 21 Pair gcd 10 17 1 Relatively prime 10 21 1 Relatively prime 17 21 1 Relatively prime Determine whether the integers 10, 19, and 24 are pairwise relatively prime. 10 1, 2, 5, 10 19 1, 19 24 1, 2, 3, 4, 6, 8, 12, 24 Pair gcd 10 19 1 Relatively prime 10 24 2 Not relatively prime 19 24 1 Relatively prime Prime factorization method of finding the greatest common divisor: 1. Find the prime factorization of both integers. 2. Identify common prime factors 3. Identify the minimum exponent common to both factorizations on common prime factors. 4. Find the product of those factors found in step 3. EXAMPLE 14 What is the greatest common divisor of 120 and 500? Integer Prime factorization 120 2 2 2 3 5 2 3 5 500 2 2 5 5 5 2 5 Common Factors 2 5 gcd 20 DEFINITION 5 The least common multiple of the positive integers a and b is the smallest positive integer that is divisible by both a and b. The least common multiple of a and b is denoted by lcm(a,b). Prime factorization method for finding the least common multiple of a and b. 1. Find the prime factorization of a. 2. Find the prime factorization of b. 3. For every prime in the factorizations of both a and b, find the largest exponent. 5

4. The least common multiple is product of the list generated in step 3. EXAMPLE 15 What is the least common multiple of 95,256 and 432? Integer Prime factorization 95,256 2 3 7 500 2 3 Maximum Factors 2 3 7 lcm 2 3 7 THEOREM 5 Let a and b be positive integers. Then gcd, lcm, 6