NOTES ON SIMPLE NUMBER THEORY DAMIEN PITMAN 1. Definitions & Theorems Definition: We say d divides m iff d is positive integer and m is an integer and there is an integer q such that m = dq. In this case, i.e., when m = dq and m, q Z and d N, we say d is a divisor of m or a factor of m and m is a multiple of d. We also say that m is divisible by d. The statement d divides m is written symbolically as d m. Theorem: If d divides a and a divides b, then d divides b. Definition: For integers a, b, and n, we say that n is a linear combination of a and b iff there are integers x and y such that n = ax + by. Theorem: If d divides a and d divides b, then d divides any linear combination of a and b. Definition: We say a number is prime iff it is an integer greater than 1 and its only positive integer divisors are 1 and itself. We say a number is composite iff it is an integer greater than 1 that has a positive integer divisor other than 1 and itself. Theorem: There are infinitely many primes. Theorem: (Division Algorithm) For any integer n and any nonzero integer d, there are unique integers q and r, that satisfy n = dq + r and 0 r < d. Definition: In the division algorithm we refer to n as the dividend, d as the divisor, q as the quotient, and r as the remainder. Comment: Notice that d being a divisor of n means that when the division algorithm is applied with d as the divisor and n as the dividend, the remainder r is zero. Thus, divisor is used in two ways. Likewise, we might say, when n is divided by d, we get a remainder r, whether r = 0 or r > 0. This double use of language should not be a problem because whenever a statement claims simply that x is a divisor of y, we understand that y = xk for some k Z. Proposition: If d divides n and d = 1, then d does not divide (n + 1). 1
NOTES ON SIMPLE NUMBER THEORY 2 Definition: We say a is congruent to b modulo d iff d (a b). Symbolically, we write a b (mod d) or a d b Theorem: For any a, b Z, and for any d N, a and b have the same remainder when divided by d if and only if a d b. Definition: Let a and b be integers that are not both 0. An integer c is a common divisor of a and b if c a and c b. The greatest common divisor of a and b is the greatest integer that is a divisor of a and b. Definition: We say integers a and b are relatively prime iff gcd(a, b) = 1. Theorem: Let a and b be integers that are not both 0. Then gcd(a, b) is the least positive integer that is a linear combination of a and b. Corollary: Two integers a and b are relatively prime if and only if 1 can be written as a linear combination of a and b. Corollary: Let a and b be integers that are not both 0. Then d = gcd(a, b) if and only if d is a common divisor of a and b such that for any other common divisor of a and b, say c, we have c d. Theorem: Let a and b be positive integers. If b = aq + r and q, r Z, then gcd(a, b) = gcd(r, a). Theorem: (Euclidean Algorithm) Let a and b be positive integers such that a < b and b = aq + r as in the division algorithm. Then it is possible to repeat the division algorithm with r as the divisor and a as the dividend. In fact, the algorithm can be performed repeatedly in this manner until some remainder divides some dividend with a remainder of zero. The least positive remainder observed in this algorithm is gcd(a, b). Theorem: Let d, a, and b be integers such that d ab. Then, if gcd(d, a) = 1, then d b. Lemma: (Euclid) Let a and b be integers and let p be a prime. Then, if p ab, then p a or p b. Theorem: Let n 2 be an integer and let a 1, a 2,..., a n be integers and let p be a prime. Then, if p divides the product a 1 a 2 a n, then p a i for some i, 1 i n. Theorem: (Fundamental Theorem of Arithmetic) For each integer n 2 there exists a unique set of prime factors {p 1, p 2,..., p k } and unique exponents m 1, m 2,..., m k satisfying n = p m 1 1 pm 2 2 p m k k.
NOTES ON SIMPLE NUMBER THEORY 3 Examples Example: Let a = 18 and b = 30 and c = 90. We can write each integer as a product of primes in increasing order: 18 = (2)(3)(3), 30 = (2)(3)(5), and 90 = (2)(3)(3)(5). The fundamental theorem of arithmetic assures us that this can always be accomplished. Let D n be the set of positive divisor of n. Then we have D 18 = {1, 2, 3, 9, 18}, D 30 = {1, 2, 3, 5, 6, 10, 15, 30}, and D 90 = {1, 2, 3, 5, 6, 9, 10, 15, 18, 30, 45, 90}. Simply through observation, we see that gcd(18, 30) = 3, gcd(18, 90) = 18, and gcd(30, 90) = 30. The Euclidean algorithm ensures that we can always find the greatest common divisor, even without knowing the factorization that the FTA says does exist. Example: Use the Euclidean Algorithm to find gcd(220, 143) and then to find x and y so that gcd(220, 143) = 220x + 143y. 11 = 220(2) + 143( 3) Example: Use the Euclidean Algorithm to show that 110 and 273 are relatively prime and then to write 1 as a linear combination of 110 and 273. 1 = 110( 67) + 273(27) (= 7370 + 7371) Proofs Theorem: Let a and b be integers that are not both 0. Then gcd(a, b) is the least positive integer that is a linear combination of a and b. Proof: Let D be the set of common divisors of a and b and let L be the set of all linear combinations of a and b that are positive. Recall that if an integer divides both a and b, then it divides any linear combinations of a and b. To reiterate, any common divisor of a and b divides every linear combination of a and b. Thus, if we could find integers u, v D L such that u = v, the we would have u D and v L, from which we see that u v, which implies that u v. But, we also would have v D and u L, so v u and v u. But then u = v, which contradicts our assumption that there were two distinct elements in D L. Thus, D L has 0 or 1 elements. Notice also that if there is an element d D L, since for any c D, we would have c d, we would know that d = gcd(a, b). By the Well-Ordering Principle, there is a least element of L. Let d be the least element of L. We show that d D, from which we will conclude that d = gcd(a, b). Let x and y be integers for which
NOTES ON SIMPLE NUMBER THEORY 4 d = ax + by. Now, using the division algorithm with a and d we have q and r such that a = dq + r, where 0 r < d. Thus r = a dq = a (ax + by)q = a(1 xq) + b( yq) Since r < d and d was the least element in L, we know r / L. It follows that r = 0 and so d a. A similar argument will verify that d b, which means d D. This completes the proof. Comment: The proof above proves the following corollary. Corollary: Let a and b be integers that are not both 0. Then d = gcd(a, b) if and only if d is a common divisor of a and b such that for any other common divisor of a and b, say c, we have c d. Theorem: Let a and b be positive integers. If b = aq + r for some integers q and r, then gcd(a, b) = gcd(r, a). Proof: Let d = gcd(a, b) and e = gcd(r, a). We will show that d = e. Notice that we have b written as a linear combination of a and r, so e divides the linear combination, which is b. Since e is assumed to divide a, this means e is a divisor of a and b, so e d. Also, since r = b aq, we can write r as a linear combination of b and a and we see that d divides the linear combination, which is r. Since d is assumed to divide a, we have d a divisor of both r and a, so d e. It follows that d = e. Theorem: Let d, a, and b be integers such that d ab. Then, if gcd(d, a) = 1, then d b. Proof: Since d ab, we can find an integer j s.t. ab = dj. Since gcd(d, a) = 1, we can find integers x and y s.t. 1 = dx + ay. Multiplying this last equation by b we get b = dbx + aby. Then substitution for ab gives us b = dbx + djy = d(bx + jy), so d b. Lemma: (Euclid s Lemma) Let a and b be integers and let p be a prime. Then, if p ab, then p a or p b. Proof: If p a, then there is nothing to prove, so we suppose that p does not divide a. Since the only positive divisor of p are 1 and p, we have gcd(a, b) = 1. But then the last theorem implies that p b. Theorem: Let n 2 be an integer and let a 1, a 2,..., a n be integers and let p be a prime. Then, if p divides the product a 1 a 2 a n, then p a i for some i, 1 i n. Proof: We use the PMI. The base case, n = 2 is Euclid s Lemma. For the inductive step, we suppose that p divides the product a 1 a 2 a k a k+1 and we let a = a 1 a 2 a k. Thus we have p aa k+1 and by Euclid s Lemma, p a or p a k+1. If p divides a k+1, then there is nothing to prove, so we assume p a, i.e., p a 1 a 2 a k. By assuming
NOTES ON SIMPLE NUMBER THEORY 5 the inductive hypothesis, we conclude that p divides at least one of a 1, a 2,..., a k. Since this proves the inductive step, the PMI implies the theorem. Theorem: (Fundamental Theorem of Arithmetic) Every integer n 2 can be expressed as a product of primes. That is, n = p 1 p 2 p k where p i is a prime for each i, 1 i k. Moreover, the factorization is unique excepting the order in which the primes are written. Notice that the p i need not be distinct and that n is prime if and only if there is only one prime factor of n. Proof: We use the SPMI on n. The base case is n = 2, for which n is already written as a product of primes. For the inductive step, n is prime then n is already written as a product of primes. Thus, we can assume that n is not prime. This means that n is composite and there exist positive integers a, b s.t. n = ab. Applying the inductive hypothesis to a and to b, we can assume that each of a and b is a product of primes, which means that their product ab = n is a product of primes. All that remains is to show that this factorization is unique except for the order in which the factors are written. Suppose to the contrary that the factorization were not unique. Then we would be able to write n = p 1 p 2 p k and n = q 1 q 2 q l where p i is prime for 1 i k and q i is prime for 1 i l and p i p i+1 for 1 i k 1 and q i q i+1 for 1 i i 1; and by the Well- Ordering Principle, there is a least index i for which p i = q i. We let m denote this index. Thus, p i = q i for 1 i < m and p m = q m. Also, we have n = p 1 p 2... p m 1 p m... p k = q 1 q 2... q m 1 q m... q l. Dividing both sides by p 1 p 2... p m 1, we arrive at p m... p k = q m... q l. But then we observe that p m divides the product q m... q l, which implies that p m divides at least one of the q i where m i l. We denote this prime by q j and conclude that since p m q j, we know p m q j. But we also know that q m q j by the ordering assumption. Thus p m q m. A symmetric argument leads to the conclusion that q m p m. But then we must conclude that p m = q m, which contradicts m being the least index for which p i = q i. The only possibility that remains is that there is no least positive index for which p i = q i, which means that p i = q i. Since this argument can be applied to the p i or the q i, we must also conclude that k = l and that the factorization is unique.