Kevin James. MTHSC 412 Section 2.4 Prime Factors and Greatest Comm



Similar documents
GREATEST COMMON DIVISOR

Today s Topics. Primes & Greatest Common Divisors

DIVISIBILITY AND GREATEST COMMON DIVISORS

8 Divisibility and prime numbers

The Prime Numbers. Definition. A prime number is a positive integer with exactly two positive divisors.

Section 4.2: The Division Algorithm and Greatest Common Divisors

GCDs and Relatively Prime Numbers! CSCI 2824, Fall 2014!

MATH10040 Chapter 2: Prime and relatively prime numbers

CHAPTER 5. Number Theory. 1. Integers and Division. Discussion

CS 103X: Discrete Structures Homework Assignment 3 Solutions

Continued Fractions and the Euclidean Algorithm

Elementary Number Theory and Methods of Proof. CSE 215, Foundations of Computer Science Stony Brook University

MATH 289 PROBLEM SET 4: NUMBER THEORY

8 Primes and Modular Arithmetic

SUM OF TWO SQUARES JAHNAVI BHASKAR

15 Prime and Composite Numbers

I. GROUPS: BASIC DEFINITIONS AND EXAMPLES

The last three chapters introduced three major proof techniques: direct,

Handout #1: Mathematical Reasoning

Handout NUMBER THEORY

Math 319 Problem Set #3 Solution 21 February 2002

The Division Algorithm for Polynomials Handout Monday March 5, 2012

CONTINUED FRACTIONS AND PELL S EQUATION. Contents 1. Continued Fractions 1 2. Solution to Pell s Equation 9 References 12

6.2 Permutations continued

Discrete Mathematics, Chapter 4: Number Theory and Cryptography

MATH 22. THE FUNDAMENTAL THEOREM of ARITHMETIC. Lecture R: 10/30/2003

Grade 6 Math Circles March 10/11, 2015 Prime Time Solutions

Chapter 4, Arithmetic in F [x] Polynomial arithmetic and the division algorithm.

How To Know If A Domain Is Unique In An Octempo (Euclidean) Or Not (Ecl)

z 0 and y even had the form

Math Abstract Algebra I Questions for Section 23: Factoring Polynomials over a Field

POLYNOMIAL RINGS AND UNIQUE FACTORIZATION DOMAINS

The Euclidean Algorithm

Homework until Test #2

Number Theory Hungarian Style. Cameron Byerley s interpretation of Csaba Szabó s lectures

Elementary Number Theory

Intermediate Math Circles March 7, 2012 Linear Diophantine Equations II

CHAPTER SIX IRREDUCIBILITY AND FACTORIZATION 1. BASIC DIVISIBILITY THEORY

Quotient Rings and Field Extensions

a 11 x 1 + a 12 x a 1n x n = b 1 a 21 x 1 + a 22 x a 2n x n = b 2.

COMMUTATIVE RINGS. Definition: A domain is a commutative ring R that satisfies the cancellation law for multiplication:

Applications of Fermat s Little Theorem and Congruences

SYSTEMS OF PYTHAGOREAN TRIPLES. Acknowledgements. I would like to thank Professor Laura Schueller for advising and guiding me

Settling a Question about Pythagorean Triples

Number Theory. Proof. Suppose otherwise. Then there would be a finite number n of primes, which we may

Solving Linear Systems, Continued and The Inverse of a Matrix

PYTHAGOREAN TRIPLES KEITH CONRAD

Lectures on Number Theory. Lars-Åke Lindahl

PROBLEM SET 6: POLYNOMIALS

SOLUTIONS FOR PROBLEM SET 2

1. MATHEMATICAL INDUCTION

SUBGROUPS OF CYCLIC GROUPS. 1. Introduction In a group G, we denote the (cyclic) group of powers of some g G by

17 Greatest Common Factors and Least Common Multiples

Winter Camp 2011 Polynomials Alexander Remorov. Polynomials. Alexander Remorov

Mathematical Induction

CONTENTS 1. Peter Kahn. Spring 2007

3. Mathematical Induction

11 Ideals Revisiting Z

Lecture 3: Finding integer solutions to systems of linear equations

So let us begin our quest to find the holy grail of real analysis.

Lecture 13 - Basic Number Theory.

Unique Factorization

Systems of Linear Equations

MATH10212 Linear Algebra. Systems of Linear Equations. Definition. An n-dimensional vector is a row or a column of n numbers (or letters): a 1.

Lemma 5.2. Let S be a set. (1) Let f and g be two permutations of S. Then the composition of f and g is a permutation of S.

The Fundamental Theorem of Arithmetic

Introduction to Finite Fields (cont.)

The Chinese Remainder Theorem

Grade 7/8 Math Circles Fall 2012 Factors and Primes

U.C. Berkeley CS276: Cryptography Handout 0.1 Luca Trevisan January, Notes on Algebra

Page 331, 38.4 Suppose a is a positive integer and p is a prime. Prove that p a if and only if the prime factorization of a contains p.

Fibonacci Numbers and Greatest Common Divisors. The Finonacci numbers are the numbers in the sequence 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144,...

ALGEBRAIC APPROACH TO COMPOSITE INTEGER FACTORIZATION

= = 3 4, Now assume that P (k) is true for some fixed k 2. This means that

Factoring Algorithms

4.2 Euclid s Classification of Pythagorean Triples

4. FIRST STEPS IN THE THEORY 4.1. A

Introduction. Appendix D Mathematical Induction D1

On the generation of elliptic curves with 16 rational torsion points by Pythagorean triples

Factoring & Primality

Discrete Mathematics and Probability Theory Fall 2009 Satish Rao, David Tse Note 2

Number Theory: A Mathemythical Approach. Student Resources. Printed Version

Chapter 3. if 2 a i then location: = i. Page 40

On the largest prime factor of x 2 1

HOMEWORK 5 SOLUTIONS. n!f n (1) lim. ln x n! + xn x. 1 = G n 1 (x). (2) k + 1 n. (n 1)!

Theorem3.1.1 Thedivisionalgorithm;theorem2.2.1insection2.2 If m, n Z and n is a positive

Factoring Polynomials

Undergraduate Notes in Mathematics. Arkansas Tech University Department of Mathematics

GENERATING SETS KEITH CONRAD

6.1 The Greatest Common Factor; Factoring by Grouping

Some Polynomial Theorems. John Kennedy Mathematics Department Santa Monica College 1900 Pico Blvd. Santa Monica, CA

minimal polyonomial Example

k, then n = p2α 1 1 pα k

MATHEMATICAL INDUCTION. Mathematical Induction. This is a powerful method to prove properties of positive integers.

Continued Fractions. Darren C. Collins

Congruent Number Problem

An Introductory Course in Elementary Number Theory. Wissam Raji

(0, 0) : order 1; (0, 1) : order 4; (0, 2) : order 2; (0, 3) : order 4; (1, 0) : order 2; (1, 1) : order 4; (1, 2) : order 2; (1, 3) : order 4.

Public Key Cryptography: RSA and Lots of Number Theory

Every Positive Integer is the Sum of Four Squares! (and other exciting problems)

Transcription:

MTHSC 412 Section 2.4 Prime Factors and Greatest Common Divisor

Greatest Common Divisor Definition Suppose that a, b Z. Then we say that d Z is a greatest common divisor (gcd) of a and b if the following conditions are satisfied. 1 d 0. 2 d a and d b. 3 If c a and c b then c d. Notation If d is the gcd of a and b we may write (a, b) = d. My Convention It is sometimes useful to define (0, 0) = 0.

Theorem Let a, b Z with at least one of them nonzero. Then there exists a unique gcd d of a and b. Moreover d can be realized as an integral linear combination of a and b. That is, there are m, n Z such that d = am + bn. Further, d is the smallest positive integer of this form.

Proof Suppose that a, b Z with at least one being nonzero. Existence: First we note that if a = 0 then (a, b) = (0, b) = b and b = a 0 + (±1) b. The case that b = 0 is similar. So, we now assume that a and b are nonzero. Let S = {ax + by x, y Z; ax + by > 0}. Note that either a or a is in S. So, S. Using the well ordering principle, let d be the least element of S. Since, d S, there are x, y Z such that d = ax + by. It is also clear that d is the smallest such number which is positive. By the division algorithm, we can write a = dq + r with 0 r < d. Then r = a dq = a (ax + by)q = a(1 xq) + b( yq). However, r < d r S, (b/c d is the least element of S). Thus r = 0 and d a. We can prove that d b in a similar way.

Proof continued... Finally suppose that c a and c b. Then we have a = ck and b = cm for some k, m Z. Thus d = ax + by = ckx + cmy = c(kx + my) and c d. So, d is the gcd of a and b. Uniqueness: Suppose now that we have two gcd s d and e. Since d a and d b and since e is a gcd, d e. Since e a and e b and since d is a gcd, e d. So, d = ek and e = dm for some k, m Z. d = dmk mk = 1 m, k = ±1. So, d = ±e. However, e, d 0 e = d.

Computing the GCD Fact If a = bq + r then (a, b) = (b, r). Exercise Prove this! Hint: Show that any common divisor of a and b is also a divisor of r and that any common divisor of b and r is a divisor of a.

Euclidean Algorithm Given a and b not both zero, first note that (a, b) = ( a, b ). So we may replace a and b by a and b respectively. Thus after rearrangement if necessary we can assume that a 0 and that b > 0. Use the division algorithm to write a = bq + r; 0 r < b Then recall that (a, b) = (b, r). Now repeat the process with a replaced by b and b replaced by r. Continue in this manner until you encounter a remainder of 0 and note that (b, 0) = b.

Example Compute the (246, 180). 246 = 180(1) + 66 (246, 180) = (180, 66). 180 = 66(2) + 48 (180, 66) = (66, 48). 66 = 48(1) + 18 (66, 48) = (48, 18). 48 = 18(2) + 12 (48, 18) = (18, 12). 18 = 12(1) + 6 (18, 12) = (12, 6). 12 = 6(2) + 0 (12, 6) = (6, 0) = 6!

Finding x and y The Euclidean algorithm produces: a = bq 1 + r 1 r 1 = a bq b = r 1 q 2 + r 2 r 2 = b r 1 q 2 r 1 = r 2 q 3 + r 3 r 3 = r 1 r 2 q 3 r 2 = r 3 q 4 + r 4 r 4 = r 2 r 3 q 4.. r i 2 = r i 1 q i + r i r i = r i 2 r i 1 q i.... r n 3 = r n 2 q n 1 + r n 1 r n 1 = r n 3 r n 2 q n 1 r n 2 = r n 1 q n + r n r n = r n 2 r n 1 q n r n 1 = r n q n+1 + 0 Note that (a, b) = r n and we can use successive back substitution to write r n in terms of r k and r k 1 eventually expressing r n in terms of a and b.

Example Let s reconsider our previous example: (246, 180) = 6. 246 = 180(1) + 66 66 = 246 + ( 1)180 180 = 66(2) + 48 48 = 180 + ( 2)66 66 = 48(1) + 18 18 = 66 + ( 1)48 48 = 18(2) + 12 12 = 48 + ( 2)18 18 = 12(1) + 6 6 = 18 + ( 1)12 12 = 6(2) + 0 Now write 6 = 18 + ( 1)12 = 18 + ( 1)[48 + ( 2)18] = (3)18 + ( 1)48 = (3)[66 + ( 1)48] + ( 1)48 = (3)66 + ( 4)48 = (3)66 + ( 4)[180 + ( 2)66] = (11)66 + ( 4)180 = (11)[246 + ( 1)180] + ( 4)180 = (11)246 + ( 15)180. So, take x = 11 and y = 15.

Relatively Prime Integers Definition Two integers a and b are relatively prime or coprime if (a, b) = 1. Theorem If a and b are coprime and a bc then a c.

Proof. Since a and b are coprime, there are x, y Z such that ax + by = 1. Since a bc there is k Z such that bc = ak. So, 1 = ax + by c = acx + bcy c = acx + aky (because bc = ak) c = a(cx + ky) a c.

Primes Definition An integer p is a prime if p > 1 and if the only positive divisors of p are 1 and p. Theorem (Euclid s Lemma) If p is a prime and p ab then p a or p b. Proof. Suppose that p ab. If p a then the conclusion of the theorem holds. Now, suppose that p a. Then (a, p) = 1 because the only positive divisors of p are 1 and p. Thus by our previous theorem, p b.

Corollary 1 If p (a 1 a 2... a n ) then p a i for some 1 i n. 2 If p a m then p a. Proof. We will prove part 1 by induction on n. The result is trivial when n = 1. Now suppose that the result holds for n = k for some k 1. Now, suppose that p (a 1 a 2... a k+1 ) = (a 1 a 2... a k ) a k+1. If p a k+1 then the conclusion of the theorem holds. If p a k+1 then by Euclid s lemma, p (a 1 a 3... a k ). In thisr case, our induction hypothesis implies that p a i for a i k and the conclusion of the theorem holds. Part 2 follows from part 1.

Unique Factorization Theorem (Fundamental Theorem of Arithmetic) Every integer n 2 can be expressed as a product of primes and this factorization is unique up to rearrangement of the factors.

Proof Existence: Since 2 is prime, the theorem holds for n=2. Suppose that the theorem holds for 2 n k for some k 2. Let s consider k + 1. If k + 1 is prime then it is already factored. If k + 1 is not prime then it has a divisor other than itself and 1. Thus we can write k + 1 = mr with 1 < m r < k + 1. Since 2 m r k our induction hypothesis implies that both m and r can be factored into primes, say m = p 1 p j, r = q 1 q i. Then k + 1 = mr = p 1 p j q 1 q i is a prime factorization of k + 1. It follows by strong induction than any n 2 has a factorization into primes.

Proof continued... Uniqueness: Suppose that we have two factorizations of n: n = p 1... p t and n = q 1... q s with t s. p 1... p t = q 1... q s Thus p 1 (q 1... q s ). By our corollary, p 1 q i for some 1 i s. After relabeling the q i s we may assume that p 1 q 1. Since, q 1 is prime, it follows that p 1 = q 1 and we have p 1... p t = p 1 q 2... q s p 2... p t = q 2... q s. Repeating this argument, we see that after relabeling the q i s, we will have p 1 = q 1, p 2 = q 2,..., p t 1 = q t 1 and p t = q t... q s. Since p t is prime, it follows that there must be only one prime on the right (i.e. s = t) and p t = q t.

Corollary If n 2 then there are primes p 1 < p 2 < < p k and positive integers e 1,..., e k such that and this factorization is unique. n = p e 1 1... pe k k,

How many primes? Theorem (Euclid s Theorem) There are infinitely many primes. Proof. We will show that any finite list of primes is incomplete. Suppose that p 1, p 2,..., p k is a list of primes. Consider n = (p 1 p 2... p k ) + 1. Now FTA guarantees us that n has at least one prime factor, say q. If q (p 1... p k ) then we would be able to write (p 1... p k ) = qm and n = qr for some m, r Z, and then we would have 1 = n (p 1... p k ) = qm qr = q(m r) q 1 which cannot be true. Thus q (p 1... p k ), and we have found a prime q which was not on our list. Thus any finite list of primes is incomplete.