Some practice problems for midterm 2 Kiumars Kaveh November 15, 2011 Problem: What is the remainder of 6 2000 when divided by 11? Solution: This is a long-winded way of asking for the value of 6 2000 mod 11. Since 11 is prime and 6 is not a multiple of 11, it follows from Fermat s Theorem that 6 10 1 mod 11. Therefore 6 2000 = (6 1 0) 2 00 1 200 1 mod 11. Problem: Show that if p and q are distinct primes then p q 1 +q p 1 1 mod pq. Solution: Since p and q are distinct primes, q is not a multiple of p, and so, by Fermat s theorem, q p 1 1 mod p. Also, since p is clearly a divisor of p q 1, we have: p q 1 0 mod p. Adding the displayed congruences above gives Interchanging the roles of p an q gives: p q 1 + q p 1 1 mod p. p q 1 + q p 1 1 mod q. Thus we obtain that the number p q 1 + q p 1 1 is divisible by both p and q. Since p and a are distinct, they are relatively prime and hence p q 1 + q p 1 1 is divisible by pq. Problem: Find the last digit of the decimal expansion of 7 999999. Solution: You are asked to find 7 999999 mod 10. We have φ(10) = φ(2 5) = φ(2)φ(5) = 1 4 = 4, so, by Euler s theorem, Divide the exponent by 4, obtaining 7 4 1 mod 10. 999999 = 4249999 + 3. 1
Therefore: 7 999999 = 7 4 249999+3 = (7 4 ) 24999973 7 3 7 3 3 mod 10. Problem: Find: (a) φ(2 8 ), (b) φ(10!). Solution: (a) φ(2 8 ) = (2 1)2 7 = 128. (b) φ(10!) = φ(2 8 3 4 5 2 7) = φ(2 8 )φ(3 4 )φ(5 2 )φ(7) = (2 1)2 7 (3 1)3 3 (5 1)5 (7 1) = 2 11 3 4 5. Problem: Find all positive integers n such that φ(n) = 12. Solution: It will be useful to first find all solutions to φ(n) = 6. Solutions cannot be divisible by any prime greater than 7, and cannot be divisible by 7 2, 5 2, 3 3, or 2 4. The solutions divisible by 7 are n = 7 and n = 14. If there were a solution n divisible by 5, the φ(n) would be divisible by 4. Since 6 is not divisible by 4, there are no solutions divisible by 5. If n is a solutions divisible by 3 2, then n = 3 2 k with (k, 3) = 1, so 6 = φ(n) = φ(3 2 )φ(k) = 6φ(k), and so φ(k) = 1, and k must be either 1 or 2. Therefore the only solutions divisible by 3 2 are n = 9 and n = 18. If n is a solution divisible by 3 but not by 3 2, then n = 3k with (k, 3) = 1, so φ(n) = φ(3)φ(k) = 2φ(k), and so φ(k) = 3. Since this is impossible, there are no solutions divisible by 3 but not divisible by 9. Finally, there are no solutions which are powers of 2. Thus the solutions to φ(n) = 6 are n = 7, n = 9, n = 14, and n = 18. Now lets turn to finding the solutions to φ(n) = 12. A solution cannot be divisible by any prime greater than 13. If n is divisible by 13, then n = 13k with (k, 13) = 1, so 12 = φ(13)φ(k) = 12φ(k), and therefore k must be 1 or 2. Thus the only solutions divisible by 13 are n = 13 and n = 26. Since 11 1 is not a divisor of 12, there are no solutions divisible by 11. Since 7 is not a divisor of n, there are no solutions divisible by 72. Thus if n is a solution divisible by 7, then n = 7k with (k, 7) = 1, so 12 = φ(7)φ(k) = 6φ(k), and therefore φ(k) = 2, so k can only be 3, 4, or 6, each of which is relatively prime to 7. Therefore the solutions that are divisible by 7 are n = 21, n = 28, and n = 42. Next, lets find the solutions that are divisible by 3. First, n cannot be divisible by 3 3. Consider first the case when 3 2 is a divisor of n. In this case, n = 3 2 k with (k, 3) = 1, so 12 = φ(32)φ(k) = 6φ(k), and so φ(k) = 2. The possibilities for k are 3, 4, and 6, but only 4 is relatively prime to 3. Thus the only solution divisible by 32 is n = 36. For solutions divisible by 3 but not by 32, we have n = 3k with (k, 3) = 1, so 12 = φ(3)φ(k) = 2φ(k), and therefore φ(k) = 6. By the result of the previous paragraph, the only possibilities that are relatively prime to 3 are 7 and 14, which give the previously found solutions n = 21 and n = 42. Finally, there are no solutions which are powers of 2. Thus the solutions to φ(n) = 12 are n = 13, n = 21, n = 26, n = 28, n = 36, and n = 42. Problem: For which positive integers n is φ(n) divisible by 4? Solution: The possibilities are: 1) n has two distinct odd prime factors. 2) n is divisible by 4 and has an odd prime factor. 3) n has a prime factor p such 2
that p 1 is divisible by 4. 4) n is divisible by 8. Problem: If two most common letters in a long ciphertext, encrypted by an affine transformation C ap + b mod 26, are X and Q, respectively, then what are the most likely values for a and b? Solution: Since the most frequently occurring letters in English text are e and t respectively, they probably correspond to the ciphertext X and Q. The numerical equivalents of e, t, X, and Q are 4, 19, 16, and 23 respectively. Thus we expect that 4 encrypts to 16 and 19 encrypts to 23. This gives the system of congruences 4a + b 16 mod 26 19a + b 23 mod 26 Subtracting the first from the second gives: 15a 7 mod 26. Solving for a gives a = 23 (up to congruence), and substituting this value into the first of the above congruences gives: 4 23 + b 16 mod 26, so b = 4 (up to congruence). Thus the encryption rule is C = 23P + 4. Problem: Find the number of positive divisors of: (a) 36, (b) 2 3 5 7 11 13 17 19. Solution: (a) τ(36) = τ(2 2 3 2 ) = 3 3 = 9. (b) τ(2 3 5 7 11 13 17 19) = 2 8. Problem: For which integers n the sum of divisors σ(n) is odd? Solution: Let n = p α1 1 pαr r with p 1,..., p r distinct primes and α 1 for k = 1,..., r. Then σ(n) = σ(p α1 1 ) σ(pαr r ), so in order for σ(n) to be odd, each of the factors on the right must be odd. We must therefore decide when σ(p α ) is odd. Consider first the case p = 2. In this case σ(2 α ) = 2 α+1 1 is odd for every α 1. On the other hand, for p > 2, σ(p α ) = 1 + p + + p α is a sum of α + 1 odd numbers, so σ(p α ) has the same parity as α + 1. In other words, σ(p α ) is odd if and only if α is even. It follows that in order for σ(n) to be odd it is necessary and sufficient that n have the form n = 2 α0 p α1 1 pαr r, with p 1,..., p r distinct odd primes and α 1,..., α r even. Equivalently, n is either a perfect square, or 2 times a perfect square. 3
Problem: Prove that Dirichlet product is associative, that is, if f, g, h are arithmetic functions then f (g h) = (f g) h. Solution: Recall that for any integer n > 0: (f g)(n) = d n f(d)g(n/d). Thus ((f g) h)(n) = d n ( e d f(e)g(d/e))h(n/d) = d n f(e)g(d/e)h(n/d). Note that e d/e n/d = n, in fact when d runs through the (positive) divisors of n, and e runs through the (positive) divisors of d, the integers (e, e/d, n/d) run through all the triples of positive integers (a, b, c) with abc = n, that is: ((f g) h)(n) = f(a)g(b)h(c), (a,b,c) where the sum is over triples of positive integers (a, b, c) with abc = n. Similarly one shows that (f (g h))(n) is equal to the same sum. This proves the claim. Problem: Find the value of (a) µ(10!), (b) µ(2 17 19), where µ is the Möbius µ-function. Solution: 10! is divisible by 2 2 = 4, thus by definition µ(10!) is equal to 0. (b) 2 17 19 is a product 3 distinct prime numbers, so by definition its µ is equal to ( 1) 3 = 1. Problem: As usual let τ(n) denote the number of (positive) divisors of n. Show that for any positive integer n we have: n = d n τ(d)µ(n/d). e d Solution: By definition: τ(n) = d n 1. That is, τ is the summatory function of 1, the constant function 1. Applying the Möbius inveresion formula we get the desired equality. Problem: Show that if k > 1 is an integer, then the equation τ(n) = k has infinitely many solutions. Solution: For any prime number p, n = p k 1 is a solution to τ(n) = k. Since there are infinitely many primes, there are infinitely many solutions. 4
Problem: Which positive integers have exactly four positive divisors? We want to find all solutions to τ(n) = 4. First, if n has three distinct prime factors, then τ(n) 8, so any solution to τ(n) = 4 can have at most two distinct prime factors. Consider first the case when n has only one prime divisor p, so that n = p α for some positive integer α. Then τ(n) = α + 1, so τ(n) = 4 if and only if α = 3. Thus the solutions of τ(n) = 4 with only one prime divisor are the numbers n = p 3 where p is prime. Next, consider the case when n has distinct prime divisors p and q. then n = p α q β where α and β are positive integers, and so τ(n) = τ(p α q β ) = (α + 1)(β + 1). This product equals 4 if and only if each factor equals 2, which happens if and only if α = β = 1. Thus the solutions to τ(n) = 4 with two distinct prime factors are of the form n = pq where p and q are distinct primes. In summary, the solutions to τ(n) = 4 are either cubes of primes, or products of two distinct primes. Problem: Show that a positive integer n is composite if and only if σ(n) > n + n. Solution: Suppose that n is composite. I claim that n has a divisor d with n d < n. To see this, note that, since n is composite, it has a divisor d1 with 1 < d 1 < n. If d 1 n, let d = d 1. Otherwise, let d = n/d 1. Now note that 1, d, and n are distinct divisors of n, so σ(n) 1 + d + n 1 + n + n > n + n. Now suppose n is not composite. We must show that σ(n) n + n. This is trivial if n = 1, so it remains to consider the case n prime. In this case, the only positive divisors of n are n and 1. Thus σ(n) = n + 1 < n + n. Problem: If the cipher text message produced by RSA encryption with the key (e, n) = (5, 2881) is: what is the plaintext message? 0504 1874 0347 0515 2088 2356 0736 0468 The modulus n = 2881 must be a product of two distinct primes, and one of the factors must be less than 2881 53.7. I can therefore find a prime factor by trying each prime less than or equal to 53. One quickly arrives at the divisor 43, and the factorization 2881 = 4367. Therefore φ(2881) = 4266 = 2772, so the decryption exponent is d = 5 1 mod 2772 = 1109, and so the decryption rule is x = c 1109 mod 2881. Applying this to each of the given ciphertext blocks yields the plaintext blocks 0400 1902 0714 0214 1100 1904 0200 1004. The text equivalent is: ea tc ho co la te cake (In the exam we will have much smaller numbers). Problem: Determine (a) ord 17 (2), (b) ord 13 (11). 5
Solution: (a) The order must divide φ(17) = 16, so it must be 1, 2, 4, 8, or 16. Just calculate: 2 1 mod 17 = 2 so ord 17 (2) = 8. 2 2 mod 17 = 4 2 4 mod 17 = 4 2 mod 17 = 16 2 8 mod 17 = 16 2 mod 17 = 1 (b) The order must divide φ(21) = 12, so it must be 1, 2, 3, 4, 6, or 12. We have: 10 1 mod 21 = 10 so ord 21 (10) = 6. 10 2 mod 21 = 16 10 3 mod 21 = 10 16 mod 21 = 13 10 4 mod 21 = 16 2 mod 21 = 4 10 6 mod 21 = 16 4 mod 21 = 1 Problem: Show that the integer 20 has no primitive roots. Solution: φ(20) = φ(8 5) = 4 4 = 16. We have to show that no element in Z 20 has order 16. We have Z 20 = {1, 3, 7, 9, 11, 13, 17, 19}. One computes that 3 4 = 27 3 7 3 1 mod 20 and thus ord 20 (3) = 4. We also have 3 1 = 7 mod 20 so ord 20 (7) = 4 as well. Also 9 2 = 81 1 mod 20 so ord 20 9 = 2. Finally 11 9 mod 20, 13 7 mod 20, 17 3 mod 20 and 19 1 mod 20. Thus none of them has order 16 as required. Problem: Find a complete set of incongruent primitive roots of 19. Solution: Since 19 1 = 2 3 2, a number a Z 19 is a generator if and only if a 6 1 mod 19 and a 9 1 mod 19. Since 26 mod 19 = 7 and 29 mod 19 = 18, it follows that 2 is a generator, and the other generators are given by 2 j where j is relatively prime to 18. Thus the generators are 2 1 mod 19 = 2 2 5 mod 19 = 13 2 7 mod 19 = 14 2 11 mod 19 = 15 2 13 mod 19 = 3 2 17 mod 19 = 10 6
Problem: Show that if p is a prime and p 1 mod 4 then there is an integer x such that x 2 1 mod p. Solution: Since 4 p 1,there is an x Z p of order 4. Therefore x 2 1 in Z p, but x 4 = 1 in Z p. Therefore x 2 and 1 are distinct solutions to y 2 1 = 0. But we also know that 1 is a solution, which is distinct from 1 since p 2. It follows that x 2 = 1 in Z p. 7