You are on page 1of 7

NUMBER THEORY

4.1 Divisiblity
Definition 1: a | b ::= [ak = b for some k] The following all say the same thing: - a|b - a divides b - b is divisible by a - a is a divisor/ factor of b - b is a multiple of a A perfect number is equal to the sum of its positive integral divisors, excluding itself. For example, 6 = 1 + 2 + 3 and 28 = 1 + 2 + 4 + 7 + 14 are perfect number Definition 2: A prime is a number greater than 1 that is divisible only by itself and 1 (therefore, 1 is not a prime) 4.1.1 Facts about divisibility 1. If a | b and b | c, then a | c 2. If a | b and a | c. then a | sb + tc for all s and t 3. For all c 0, a | b if and only if ca | cb Definition 3: An integer n is a linear combination of numbers b0, ,bniff n = s0b0 + s1b1 + + snbn for some integers s0, , sn 4.1.2 When Divisibility goes bad Division Theorem: Let n and d be integers such that d > 0. Then there exists a unique pair of integers q and r, such that n = q . d + r AND 0 r < d The number q is called the quotient and the number r is called the remainder of n divided by d. For example, qcnt(2716, 10) = 271 and rem(2716, 10) = 6 since 2716 = 271 . 10 + 6

4.2 The greatest common divisor


4.2.1 Lemma: gcd(a, b) = gcd(b, rem(a, b)) Proof:

a = qb + r. Because a is a linear combination of b and r so any divisor of b and r is also divisor of a. Likewise, r is a linear combination of a and b so any divisor of a and b is also divisor of r. This means that a and b have the same common divisors as b and r, and so they have the same greatest common divisor. 4.2.2 The Pulverizer Theorem: The greatest common divisor of a and b is a linear combination of a and b. That is, gcd(a, b) = sa + tb, for some integers s and t

Proof: The theorem is proved using a Pulverizer: For example: we want to compute gcd(259, 70):

At each steps we compute the rem(x, y) as a linear combination of the original x and y. The final rem, also the gcd is therefore represented as a linear combination of the original x and y. Corollary: An integer is a linear combination of a and b iff it is a multiple of gcd(a, b)

4.3 The Fundamental Theorem of Arithmetic


Theorem (Fundamental Theorem of Arithmetic) Every integer greater than 1 is a product of a unique weakly decreasing sequence of primes. In other words, integer greater than 1 can be built up from primes in exactly one way. Proof: In order to prove the Fundamental Theorem of Arithmetic we need the following 2 lemmas: Lemma 1 If p is a prime and p | ab, then p | a or p | b Proof: If gcd(a, p) = p then the claim holds because a is a multiple of p

If not, gcd(a, p) = 1 because p is the multiple of only 1 and p. 1 = sa + tp. b= s(ab) + (tb)p (Multiply both side by b) Since p divides both ab and p. p | b because b is a linear combination of ab and p Lemma 2 Let p be a prime. If p | a1a2 an , then p divides some ai. Proof: the proof is by conduction. The Fundamental Theorem of Arithmetic is proved by using Well Ordering Principle. Assume that there are positive numbers that can be expressed as product of primes in more than one way. By the Well Ordering Principle, there is a smallest integer with this property. Call this integer n, and let n = p1 . p2 ... pj = q1 . q2 ... qj Since p1 | n, p1 | q1 . q2 ... qj.. By lemma 2, p1 must divide some qk. Because p1 is prime, p1 must be equal to qk. Deleting p1 from the first product and qk from the second, we find that n / p1 is a positive integer smaller than n than can also be written as a product of primes in two distinct way. This is a contradiction from the assumption that n is the smallest number having that property.

4.5 Modular Arithmetic


Definition A is congruent to b modulo n iff n | (a - b). This is written a b (mod n) For example: 29 15 (mod 7) because 7 | (29 - 15) Lemma (Remainder) a b (mod n) iff rem(a, n) = rem(b, n) Lemma a a (mod n) (reflexivity) a b iff b a (mod n) (symmetry) (a b and b c) implies a c (mod n) Corollary a rem(a, n) (mod n) Proof: Because rem(a, n) = rem(rem(a, n), n) since 0 <= rem(a, n) < n Lemma For n 1, if a b (mod n) and c d (mod n), then

(transitivity)

1. a + c b + d (mod n) 2. ac bd (mod n) Proof 1. n divides (a b) n divides (a + c) (b + c) n divides (c d) n divides (c + b) (d + b) n divides (a + c) (b + d) 2. n divides (a b) n divides c(a - b) = ca cb n divides (c d) n divides b(c - d) = bc bd n divides (ca cb) + (bc bd) = (ca bd)

4.6 Arithmetic with a Prime modulus (mod p p is prime)


4.6.1 Multiplicative inverses Definition The multiplicative inverse of a number x is another number x-1 such that: x .x-1 = 1 Also, since 7 . 3 1 (mod 5), we also say 3 is the multiplicative inverse of 7 When we are working modulo a prime number (exp: mod 5, mod 7, mod 11), every number that is not congruent to 0 has a multiplicative inverse. For example: Because 7 is not congruent to 0 mod 5, we can find a multiplicative of 7 such as 8 so that 7.8 1 (mod 5). Also, any numbers congruent to 8 mod 5 such as 3, 13 is also a multiplicative of 7 Lemma If p is prime and k is not a multiple of p, then k has a multiplicative inverse modulo p Proof Since p is prime it only has only 2 divisors, 1 and p. And since k is not a multiple of p, we must have gcd(p, k) = 1. Therefore, there is a linear combination of p and k equal to 1: sp + tk = 1 Or sp = 1 tk This implies that p | (1 tk), and therefore tk 1 (mod p) by the definition of congruence. Thus, t is a multiplicative inverse of k 4.6.2 Cancellation Lemma Suppose p is a prime and k is not a multiple of p. Then ak bk (mod p) IMPLIES a b (mod p) Proof Multiply both side by k-1 akk-1 bkk-1 (mod p) -1 akk a (mod p) because kk-1 1 (mod p) bkk-1 b (mod p) because kk-1 1 (mod p) Therefore, a b (mod p)

Corollary Suppose p is a prime and k is not a multiple of p. Then the sequence: rem((1 . k), p), rem((2 . k), p), , rem(((p - 1) . k), p) is a permutation of the sequence: 1, 2, , (p - 1) (A permutation of a sequence of elements is a reordering of the elements) Proof We need to show the sequence of remainderscontains p 1 distinct numbers from 1 to p 1. - Clearly, The sequence of remainders contains p - 1 numbers. - Since i .k is not divisible by p for i = 1, p -1 all these remainders are in the range 1 to p 1. - They are also distinct because if not, assume that there 2 two identical remainders rem((m . k), p), rem((n . k), p). Because rem((m . k), p) = rem((n . k), p), m . k n . k (mod p).By cancellation, m n (mod p). This is absurd because m and n are 2 distinct numbers from 1 to p 1. Example Suppose p = 5 and k = 3. Then the sequence rem((1.3), 5), rem((2.3), 5), rem((3.3), 5), rem((4.3), 5) =3 =1 =4 =2 is a permutation of 1, 2, 3, 4. 4.6.3 Fermats Little Theorem Theorem Suppose p is a prime and k is not a multiple of p. Then: kp 1 1 (mod p) Proof (p - 1)! ::= 1 . 2 . . . (p - 1) = rem(k, p) . rem(2k, p) . . . rem((p 1)k, p) k . 2k . . . (p - 1)k (mod p) (p - 1)! .kp 1 (mod p) (p 1) is not a multiple of p because the prime factorization of 1, 2, . . . , (p - 1) contain only primes smaller than p. So we can cancel (p - 1), which proves the claim. Using Fermats Little Theorem, we can find the inverse of k modulo p: Since kp 2 .k 1 (mod p), therefore kp 2 must be a multiplicative inverse of k. For example, we want to find the multiplicative inverse of 6 modulo 17 We need to compute rem(615, 17), which we can do by successive squaring:

Therefore, rem(615, 17) = 3

4.7 Arithmetic with an Arbitrary Modulus (mod n) n is an arbitrary number


4.7.1 Relative Primality Definition Integers a and b are relatively prime iffgcd(a, b) = 1. For example, 8 and 15 are relatively prime, since gcd(8, 15) = 1 Lemma 4.7.1 Let n be a positive integer. If k is relatively primeto n, then there exists an integer k-1 such that: k .k-1= 1 (mod n) As a consequence of this lemma, we can cancel a multiplicative term from both sides of a congruence if that term is relatively prime to the modulus Corollary 4.7.2 Suppose n is a positive integer and k is relatively prime to n. If ak bk (mod n) then a b (mod n) Lemma 4.7.3 Suppose n is a positive integer and k is relatively prime to n. Let k1, . . ..krdenote all the integers relatively prime to n in the range 1 to n 1. Then the sequence rem(k1 . k, n), rem(k2 . k, n),rem(k3 . k, n), . . . , rem(kr . k, n) is a permutation of the sequence: k1, k2, . . . ,kr Proof. We will show that the remainders in the first sequence are all distinct and are equal to some member of the sequence of kjs. First, we will show that the remainders are in the first sequence are all distinct. Suppose that rem(kik, n) = rem(kjk, n)kik kjk (mod n) ki kj(mod n) (by cancellation) ki = kj(because both are between 1 and n - 1) that is contradictory. Next, we show that each remainder in the first sequence equals one of the ki. If we can show that that gcd(rem(kik,n), n) = 1, and since 1 <= rem(kik,n) < n, rem(kik,n) must be equal to one of the ki. We can see that, gcd(rem(kik,n), n) = gcd(kik, n). Because gcd(ki, n) = 1 and gcd(kj, n) = 1,gcd(kik, n) = 1. Therefore, gcd(rem(kik,n), n) = 1. This finishes our proof.

4.7.2 Eulers Theorem Definition (n) denotes the number of number in [1, n] which are relatively prime to n. For example, (7) = 6 since 1, 2, 3, 4, 5, 6 are all relatively prime to 7. Theorem 4.7.4

For any number n, if p1, p2, . . .,pj are the (distinct) prime factors of n, then 1 1 1 (n) = n (1 - ) (1 - ) . . . (1 - )
1 2

For example

Corollary 4.7.5 Let n = pq where p and q are different primes. Then (n) = (p - 1)(q 1) Proof Since n = pq and p, q are primes, any number that are not relatively prime to n must be a multiple of p or a multiple of q. Among the number 1, 2, . . . ,pq, there are precisely q multiples of p and p multiples of q . Since p and q are relatively prime, the only number in [1, pq] that is multiple of both p and q is pq. Hence, there are p + q 1 numbers in [1, pq] that are not relatively prime to n. This means that (n) = pq p q + 1 = (p 1)(q - 1)

Theorem 4.7.6 (Eulers Theorem). Suppose n is a positive integer and k is relatively prime to n. Then k(n) 1 (mod n)

You might also like