SOLUTIONS TO PROBLEM SET 3

Section 6.1

Exercise 4. We want to find r ∈ Z such that 5!25! ≡ r (mod 31) and 0 ≤ r ≤ 30. By Wilson’s theorem 30! ≡ −1 (mod 31). Then, 5 6 5!25! ≡ 25! ⋅ (−26) ⋅ (−27) ⋅ (−28) ⋅ (−29) ⋅ (−30) ≡ (−1) 30! ≡ (−1) ≡ 1 (mod 31), that is r = 1. Exercise 10. We want to find r ∈ Z such that 2000 6 ≡ r (mod 11) and 0 ≤ r ≤ 10. Since 11 is prime and (6, 11) = 1 by Fermat’s little theorem we have 610 ≡ 1 (mod 11). Then, 2000 10 200 200 6 = (6 ) ≡ 1 ≡ 1 (mod 11), thus r = 1. Exercise 12. We want to find r ∈ Z such that 1000000 2 ≡ r (mod 17) and 0 ≤ r ≤ 16. Since 17 is prime and (2, 17) = 1 by FLT we have 216 ≡ 1 (mod 17). Then, 1000000 16 22⋅56 2 = (2 ) ≡ 1 (mod 17), thus r = 1. Exercise 24. It is a corollary of FLT that ap ≡ a (mod p) for all a ∈ Z. Then p p p p 1 + 2 + 3 + ... + (p − 1) ≡ 1 + 2 + 3 + ... + (p − 1)(mod p). Note that since p is odd p − 1 is even and p 1 2p p 1 p 1 p − − + + . − 2 = 2 = 2 Moreover, we can rearrange the sum above as the following sum of (p − 1)~2 terms p 1 p 1 1 2 3 ... p 1 1 p 1 2 p 2 ... − + mod p + + + + ( − ) ≡ ( + ( − )) + ( + ( − )) + + ( 2 + 2 )( ) ≡ p + p + . . . p ≡ 0 (mod p). 1 Section 6.2

Exercise 2. Note that 45 = 9 ⋅ 5 is composite and (17, 45) = (19, 45) = 1. We have

4 4 4 4 17 ≡ 2 ≡ 16 ≡ 1 (mod 5) and 17 ≡ (−1) ≡ 1 (mod 9). Since (5, 9) = 1 the CRT implies that 174 ≡ 1 (mod 45), therefore 44 4 11 17 = (17 ) ≡ 1 (mod 45) and we conclude 45 is a for the base 17. We have 2 2 2 2 19 ≡ (−1) ≡ 1 (mod 5) and 19 ≡ 1 ≡ 1 (mod 9). Since (5, 9) = 1 the CRT implies that 192 ≡ 1 (mod 45), therefore 44 2 22 19 = (19 ) ≡ 1 (mod 45) and we conclude 45 is a pseudoprime for the base 19.

Exercise 8. Let p be prime and write N = 2p − 1. − Suppose N is composite; hence p ≥ 3. Since (2, p) = 1 we have 2p 1 ≡ 1 (mod p) by FLT and − so 2p 1 − 1 = pk for some odd k ∈ Z. Thus p p−1 N − 1 = 2 − 2 = 2(2 − 1) = 2pk. Note also that 2p = N + 1 ≡ 1 (mod N); thus N−1 2pk p 2k 2 = 2 = (2 ) ≡ 1 (mod N), that is N is a pseudoprime to the base 2.

Exercise 12. An odd composite N > 0 is a for the base b if it fools Miller’s Test in base b. Recall that to be possible to apply the (k + 1)-th step of Miller’s test in base b we need

(N−1)~2k k+1 b ≡ 1 (mod N) and N − 1 is divisible by 2 .

Let N = 25. We have N − 1 = 25 − 1 = 24 = 23 ⋅ 3. We first observe that 6 2 3 3 3 7 = (7 ) ≡ 49 ≡ (−1) ≡ −1 (mod 25). We now apply Miller’s test

24 6 4 4 7 ≡ (7 ) ≡ (−1) ≡ 1 (mod 25) (i.e. 25 is a pseudoprime to base 7), 12 6 2 2 7 ≡ (7 ) ≡ (−1) ≡ 1 (mod 25), 6 7 ≡ −1 (mod 25); despite the fact that 6 is divisible by 2 the last congruence means we have to stop. Therefore 25 fools the test, i.e. it is a strong pseudoprime to the base 7. 2 Exercise 18.

a) Let m ∈ Z>0 be such that 6m + 1, 12m + 1 and 18m + 1 are prime numbers. Write n = (6m + 1)(12m + 1)(18m + 1) and let b ∈ Z≥2 satisfy (b, n) = 1. As 6m + 1 S n we also have (6m + 1, b) = 1 hence b6m ≡ 1 (mod 6m + 1) by FLT. Similarly, we conclude also that 12m 18m b ≡ 1 (mod 12m + 1) and b ≡ 1 (mod 18m + 1). Now note that 3 2 n = 6 ⋅ 12 ⋅ 18m + (6 ⋅ 12 + 6 ⋅ 18 + 12 ⋅ 18)m + 36m + 1 then 6m S n − 1, 12m S n − 1 and 18m S n − 1. Thus the following congruence hold n−1 b ≡ 1 (mod 6m + 1) n−1 b ≡ 1 (mod 12m + 1) n−1 b ≡ 1 (mod 18m + 1) and since 6m+1, 12m+1 and 18m+1 are pairwise coprime (because they are distinct primes) − by CRT we conclude that bn 1 ≡ 1 (mod n). Since b was arbitrary we conclude that n is a . Alternative proof using Korset’s criterion: Let m be a positive such that 6m + 1, 12m + 1, and 18m + 1 are primes. Then the number n = (6m + 1)(12m + 1)(18m + 1) is squarefree. Let p S n be a prime. Then p − 1 = 6m, 12m or 18m. Now note that 3 2 n = 6 ⋅ 12 ⋅ 18m + (6 ⋅ 12 + 6 ⋅ 18 + 12 ⋅ 18)m + 36m + 1 then 6m S n − 1, 12m S n − 1 and 18m S n − 1. We conclude that for all primes p S n we have p − 1 S n − 1, hence n is a Carmichael number by Korset’s criterion. b) Take respectively m = 1, 6, 35, 45, 51.

Section 6.3

Exercise 6. The question is equivalent to find r ∈ Z such that 999999 7 ≡ r (mod 10) and 0 ≤ r ≤ 9. Since (7, 10) = 1 and φ(10) = 4 then 74 ≡ 1 (mod 10) by Euler’s theorem. Note that 999996 = 4 ⋅ 249999, then 999999 999996 3 4 249999 3 3 7 = 7 ⋅ 7 = (7 ) ⋅ 7 ≡ 1 ⋅ 7 ≡ 343 ≡ 3 (mod 10), hence r = 3 is the last digit of the expansion. Remark: For the argument above we do not need the factorization 999996 = 4 ⋅ 249999. It is enough to know that 4 S 999996 which one can check (for example) using the criterion for divisibility by 4. Indeed, write 999996 = 4k; then 999999 999996 3 4 k 3 7 = 7 ⋅ 7 = (7 ) ⋅ 7 ≡ 343 ≡ 3 (mod 10), as above. This is relevant because sometimes it allows to work with very large numbers without having to find factorizations. 3 Exercise 8. Let a ∈ Z satisfy 3 ∤ a or 9 S a. It is a consequence of FLT that a7 ≡ a (mod 7). We claim that a7 ≡ a (mod 9). Note that 63 = 7 ⋅ 9 and (7, 9) = 1. Then by the CRT we conclude that a7 ≡ a (mod 63), as desired. We will now prove the claim, dividing into two cases:

(i) Suppose 9 S a; then 9 S a7 and a7 ≡ 0 ≡ a (mod 9). (ii) Suppose 3 ∤ a; then (a, 9) = 1. We have φ(9) = 6 and by Euler’s theorem we have a6 ≡ 1 (mod 9). Thus a7 ≡ a (mod 9), as desired.

Exercise 10. Let a, b ∈ Z>0 be coprime. We have φ(b) φ(b) a ≡ 1 (mod b), a ≡ 0 (mod a) and φ(a) φ(a) b ≡ 1 (mod a), b ≡ 0 (mod b). Thus we also have φ(b) φ(a) φ(b) φ(a) a + b ≡ 1 (mod a), a + b ≡ 1 (mod b) ( ) ( ) and by the CRT we conclude aφ b + bφ a ≡ 1 (mod ab), as desired.

Exercise 14. We know from the proof of CRT that the unique solution modulo M = m1 ⋅ ... ⋅ mn to the system of congruences is given by x = a1M1y1 + a2M2y2 + ... + arMryr (mod M) where Mi = M~mi and yi ∈ Z satisfies Miyi ≡ 1 (mod mi). Now note that (Mi, mi) = 1 and Euler’s theorem implies

φ(mi) φ(mi)−1 Mi = Mi ⋅ Mi ≡ 1 (mod mi),

φ(mi)−1 hence we can take yi = Mi . Inserting in the formula for x we get

φ(m1) φ(m2) φ(mr) x = a1M1 + a2M2 + ... + arMr (mod M), as desired.

Section 7.1

Exercise 4. Let φ be the Euler φ-function. Let n ∈ Z>0. If n ≠ 1 it has a prime factorization a1 a2 ak n = p1 p2 . . . pk where ak ≥ 1 and pi are distinct primes. We have k ai−1 φ(n) = M pi (pi − 1). i=1 a) Suppose φ(n) = 1. Since φ(1) = 1 then n = 1 is a solution. Suppose n ≠ 1. From the formula above it follows that pi − 1 = 1 for all i; thus 2 is the unique prime factor of n, that a a a −1 is n = 2 1 . Again by the formula we have 1 = φ(2 1 ) = 2 1 which implies a1 = 1, hence n = 2. Thus φ(n) = 1 if and only if n = 1 or n = 2. b) Suppose φ(n) = 2; thus n ≠ 1. By the formula pi − 1 S 2 for all i; thus only the primes 2 a a a −1 and 3 can divide n. Write n = 2 1 3 2 ; if a2 ≠ 0 from the formula we have 3 2 S 2 thus a2 = 1. We conclude that a2 = 0 or a2 = 1. We now divide into two cases: 4 a (i) Suppose a2 = 1, i.e. n = 2 1 ⋅ 3. If a1 ≥ 2 then the formula shows that φ(n) = 2 is divisible by 4, a contradiction. We conclude a1 ≤ 1, that is n = 3 or n = 6. Both are solutions because φ(3) = φ(6) = 2. a a −1 (ii) Suppose a2 = 0, i.e n = 2 1 with a1 ≥ 1. Then φ(n) = 2 1 = 2 implies a1 = 2, that is n = 4. Thus φ(n) = 2 if and only if n = 3, n = 4 or n = 6. c) Suppose φ(n) = 3 (hence n ≠ 1). Then pi − 1 = 1 or 3 for all i. Since pi = 4 is not a prime a we conclude that pi − 1 = 1; thus only the prime 2 divide n, that is n = 2 1 with a1 ≥ 1. a −1 Therefore φ(n) = 2 1 = 3 which is impossible for any value of a1. Thus there are no solutions to φ(n) = 3. d) Suppose φ(n) = 4 (hence n ≠ 1). Again, the formula shows that pi − 1 S 4 for all i; thus only the primes 2, 3 and 5 can divide n, that is n = 2a1 3a2 5a3 with at least one exponent ≥ 1. If a2 ≥ 2 then 3 S φ(n) = 4, a contradiction; thus a2 ≤ 1. We now divide into the cases: a a (i) Suppose a2 = 1, i.e. n = 2 1 ⋅ 3 ⋅ 5 3 . Then a a a a 4 = φ(n) = φ(3)φ(2 1 5 3 ) = 2φ(2 1 5 3 ) and we conclude φ(2a1 5a3 ) = 2. By part (b) the only m such that φ(m) = 2 are m = 3, 4, 6 and among these only m = 4 is of the form 2a1 5a3 . We conclude that a1 = 2 and a3 = 0 therefore n = 3 ⋅ 4 = 12. a a (ii) Suppose a2 = 0, i.e. n = 2 1 5 3 . Clearly, a3 ≤ 1 otherwise 5 S φ(n) = 4. a Suppose a3 = 1, that is n = 2 1 ⋅ 5. If a1 = 0 then n = 5 and φ(5) = 4 is a solution; if a −1 a1 ≥ 1 then 4 = φ(n) = 2 1 ⋅ 4 implies a1 = 1, that is n = 10. a a −1 Suppose a3 = 0, that is n = 2 1 with a1 ≥ 1. Thus φ(n) = 2 1 = 4 implies a1 = 3 that is n = 8. Thus φ(n) = 4 if and only if n = 5, 8, 10 or 12. Exercise 8. Suppose φ(n) = 14; hence n > 1. Consider the prime factorization n = a1 a2 ak p1 p2 . . . pk where ak ≥ 1 and pi are distinct primes. We have k ai−1 φ(n) = M pi (pi − 1). i=1 From the formula it follows pi − 1 S 14 for each prime pi S n, that is pi − 1 ∈ {1, 2, 7, 14}; thus pi = 2, 3, 8, 15 and we conclude that only the primes 2 and 3 can divide n. Write n = 2a1 3a2 . We have φ(n) = φ(2a1 )φ(3a2 ) = 14, but from the formula we see that 7 ∤ φ(2a1 ) and 7 ∤ φ(3a2 ), a contradiction. Thus φ(n) = 14 has no solutions.

Exercise 18. Let n ∈ Z>0 be odd; then (4, n) = 1. Since φ is a multiplicative function we have φ(4n) = φ(4)φ(n) = 2φ(n), as desired.

5