Introduction to Number Theory Number theory is about integers and their properties. We will start with the basic principles of divisibility, greatest common divisors, least common multiples, and modular arithmetic 2 2
Division If a and b are integers with a 0, we say that a dividesb if there is an integer c so that b = ac. When a divides b we say that a is a factorof b and that b is a multipleof a. The notation a bmeans that a divides b. We write a X bwhen a does not divide b. 3 3
Divisors. Examples Q: Which of the following is true? 1. 77 7 2. 7 77 3. 24 24 4. 0 24 5. 24 0 L9 4 4
Divisors. Examples A: 1. 77 7: false bigger number can t divide smaller positive number 2. 7 77: true because 77 = 7 11 3. 24 24: true because 24 = 24 1 4. 0 24: false, only 0 is divisible by 0 5. 24 0: true, 0 is divisible by every number (0 = 24 0) L9 5 5
Divisibility Theorems For integers a, b, and c it is true that if a b and a c, then a (b + c) Example:3 6 and 3 9, so 3 15. if a b, then a bcfor all integers c Example:5 10, so 5 20, 5 30, 5 40, if a b and b c, then a c Example:4 8 and 8 24, so 4 24. 6 6
Divisor Theorem THM: Let a, b, and c be integers. Then: 1. a b a c a (b+ c ) 2. a b a bc 3. a b b c a c EG: 1. 17 34 17 170 17 204 2. 17 34 17 340 3. 6 12 12 144 6 144 L9 7 7
Primes A positive integer p greater than 1 is called prime if the only positive factors of p are 1 and p. A A positive integer that is greater than 1 and is not prime is called composite. The fundamental theorem of arithmetic: Every positive integer can be writtenuniquelyas the product of primes, where the prime factors are written in order of increasing size. 8 8
Examples: Primes 15 = 48 = 17 = 100 = 512 = 515 = 28 = 3 5 2 2 2 2 3 = 24 3 17 2 2 5 5 = 22 5 2 2 2 2 2 2 2 2 2 2 = 2 9 5 103 2 2 7 = 22 7 9 9
Primes If n is a composite integer, then n has a prime divisor less than or equal n This is easy to see: if n is a composite integer, it must have two divisors p 1 and p 2 such that p 1 p 2 = n and p 1 2 and p 2 2. p 1 and p 2 cannot both be greater than, because then p 1 p 2 would be greater than n. n If the smaller number of p 1 and p 2 is not a prime itself, then it can be broken up into prime factors that are smaller than itself but 2. 10 10
Division Remember long division? d the divisor a the dividend 117 = 31 3 + 24 a = dq+r 3 31 117 93 24 q the quotient rthe remainder L9 11 11
Division THM: Let a be an integer, and d be a positive integer. There are unique integers q, r with r {0,1,2,,d-1} satisfying a = dq+r The proof is a simple application of long-division. The theorem is called the division algorithmthough really, it s long division that s the algorithm, not the theorem. L9 12 12
The Division Algorithm Let abe an integer and da positive integer. Then there are unique integers qand r, with 0 r < d, such that a = dq+ r. In the above equation, dis called the divisor, ais called the dividend, qis called the quotient, and ris called the remainder. 13 13
The Division Algorithm Example: When we divide 17 by 5, we have 17 = 5 3 + 2. 17 is the dividend, 5 is the divisor, 3 is called the quotient, and 2 is called the remainder. 14
Example: The Division Algorithm What happens when we divide -11 by 3? Note that the remainder cannot be negative. -11 = 3 (-4) + 1. -11 is the dividend, 3 is the divisor, -4 is called the quotient, and 1 is called the remainder. 15
Greatest Common Divisors Let a and b be integers, not both zero. The largest integer d such that d a and d b is called the greatest common divisorof a and b. The greatest common divisor of a and b is denoted by gcd(a, b). Example 1:What is gcd(48, 72)? The positive common divisors of 48 and 72 are 1, 2, 3, 4, 6, 8, 12, 16, and 24, so gcd(48, 72) = 24. Example 2:What is gcd(19, 72)? The only positive common divisor of 19 and 72 is 1, so gcd(19, 72) = 1. 16
Greatest Common Divisors Using prime factorizations: a = p 1 a 1 p 2 a 2 p n a n, b = p 1 b 1 p 2 b 2 p n b n, where p 1 < p 2 < < p n and a i, b i Nfor 1 i n gcd(a, b) = p 1 min(a 1, b 1) p 2 min(a 2, b 2) p n min(a n, b n ) Example: a = 60 = 2 2 3 1 5 1 b = 54 = 2 1 3 3 5 0 gcd(a, b) = 2 1 3 1 5 0 = 6 17 17
Relatively Prime Integers Definition: Two integers a and b are relatively primeif gcd(a, b) = 1. Examples: Are 15 and 28 relatively prime? Yes, gcd(15, 28) = 1. Are 55 and 28 relatively prime? Yes, gcd(55, 28) = 1. Are 35 and 28 relatively prime? No, gcd(35, 28) = 7. 18 18
Definition: Relatively Prime Integers The integers a 1, a 2,, a n arepairwiserelatively primeif gcd(a i, a j ) = 1 whenever 1 i< j n. Examples: Are 15, 17, and 27 pairwise relatively prime? No, because gcd(15, 27) = 3. Are 15, 17, and 28 pairwise relatively prime? Yes, because gcd(15, 17) = 1, gcd(15, 28) = 1 and gcd(17, 28) = 1. 19 19
Least Common Multiples Definition: The least common multipleof the positive integers a and b is the smallest positive integer that is divisible by both a and b. We denote the least common multiple of a and b by lcm(a, b). Examples: lcm(3, 7) = 21 lcm(4, 6) = 12 lcm(5, 10) = 10 February 9, 2012 Applied Discrete Mathematics Week 3: Algorithms 20 20
Least Common Multiples Using prime factorizations: a = p 1 a 1 p 2 a 2 p n a n, b = p 1 b 1 p 2 b 2 p n b n, where p 1 < p 2 < < p n and a i, b i Nfor 1 i n lcm(a, b) = p 1 max(a 1, b 1) p 2 max(a 2, b 2) p n max(a n, b n ) Example: a = 60 = 2 2 3 1 5 1 b = 54 = 2 1 3 3 5 0 lcm(a, b) = 2 2 3 3 5 1 = 4*27*5 = 540 February 9, 2012 21 21
GCD and LCM a = 60 = 2 2 3 1 5 1 b = 54 = 2 1 3 3 5 0 gcd(a, b) = 2 1 3 1 5 0 = 6 lcm(a, b) = 2 2 3 3 5 1 = 540 Theorem: a*b = gcd(a,b a,b)* lcm(a,b a,b) February 9, 2012 Applied Discrete Mathematics Week 3: Algorithms 22 22
Greatest Common Divisor Relatively Prime Let a,bbe integers, not both zero. The greatest common divisorof a and b (or gcd(a,b) ) is the biggest number d which divides both a and b. Equivalently: gcd(a,b)is smallest number which divisibly by any x dividing both aand b. a and b are said to be relatively primeif gcd(a,b) = 1, so no prime common divisors. L9 23 23
Greatest Common Divisor Relatively Prime Q: Find the following gcd s: 1. gcd(11,77) 2. gcd(33,77) 3. gcd(24,36) 4. gcd(24,25) L9 24 24
A: Greatest Common Divisor 1. gcd(11,77) = 11 2. gcd(33,77) = 11 3. gcd(24,36) = 12 Relatively Prime 4. gcd(24,25) = 1. Therefore 24 and 25 are relatively prime. NOTE: A prime number are relatively prime to all other numbers which it doesn t divide. L9 25 25
Find gcd(98,420). Greatest Common Divisor Relatively Prime Find prime decomposition of each number and find all the common factors: 98 = 2 49 = 2 7 7 420 = 2 210 = 2 2 105 = 2 2 3 35 = 2 2 3 5 7 Underline common factors: 2 7 7, 2 2 3 5 7 Therefore, gcd(98,420) = 14 L9 26 26
Greatest Common Divisor Relatively Prime Pairwiserelatively prime: the numbers a, b, c, d, are said to be pairwiserelatively prime if any two distinct numbers in the list are relatively prime. Q: Find a maximal pairwiserelatively prime subset of { 44, 28, 21, 15, 169, 17 } L9 27 27
Greatest Common Divisor Relatively Prime A: A maximal pairwiserelatively prime subset of {44, 28, 21, 15, 169, 17} : {17, 169, 28, 15} is one answer. {17, 169, 44, 15} is another answer. L9 28 28
Least Common Multiple The least common multipleof a, and b (lcm(a,b) ) is the smallest number m which is divisible by both a and b. Equivalently: lcm(a,b)is biggest number which divides any x divisible by both aand b Q: Find the lcm s: 1. lcm(10,100) 2. lcm(7,5) 3. lcm(9,21) L9 29 29
Least Common Multiple A: 1. lcm(10,100) = 100 2. lcm(7,5) = 35 3. lcm(9,21) = 63 THM: lcm(a,b) = ab / gcd(a,b) L9 30 30