Computer Laboratory Home Page Search A-Z Directory Help
University of Cambridge Home Computer Laboratory
Hints for the exercises on modular arithmetic
Computer Laboratory > Course material > Discrete Mathematics > Hints for the exercises on modular arithmetic

Please do try the questions by yourself before resorting to these hints!

  1. 10 ≡ 1 (mod 9) so 10k ≡ 1 (mod 9) and Σdk10k ≡ Σ dk (mod 9)
  2. 10 ≡ -1 (mod 11) so 10k ≡ (-1)k (mod 11) and Σdk10k ≡ Σ (-1)kdk (mod 9)
  3. The sum of the digits 0 to 9 is congruent to 0 (mod 9), but 100 ≡ 1 (mod 9).
  4. 1. (99 = 9.11, use the first two questions.)
  5. A transposition of digits k and k+1 from de to ed makes a difference of [dk + e(k+1)] - [ek + d(k+1)] = e - d to the weighted sum. A change from dde to dee makes a difference of (d-e)k. A base of 10 would mask errors where d-e = 2 and k = 5.
  6. Consider modulo 2.
  7. x ≡ 23 (mod 40).
    y ≡ 7 (mod 9).
    z ≡ 12 (mod 17) so z ≡ 97 (mod 357).
  8. 408.
  9. 21! ≡ 1 (mod 23) as in the proof of Wilson’s Theorem. 2122 ≡ 1 (mod 23) by Fermat. 21 ≡ -2 (mod 23) and 2.12 = 24 ≡ 1 (mod 23) so 21.11 ≡ (-2).(-12) ≡ 1 (mod 23). 20! 2120 ≡ 11³ ≡ 20 (mod 23).
  10. a256 ≡ 1 (mod 257) by Fermat and 256 = 28 | 109 so a1000000000 ≡ 1 (mod 257).
  11. Observe 42 = 2.3.7 and observe n7 ≡ n (mod p) for p = 2, 3 and 7.
  12. 3901 = 47.83. 1997.17 ≡ 1 (mod 46.82). only_eight_more_terms!
  13. If a = kpi then a ≡ 0 (mod p) so ade ≡ 0 (mod p). However ade = a.a-φ(p)φ(q)c ≡ a.1-φ(p)c (mod q) = a. Use the Chinese Remainder Theorem.
  14. Not all numbers are squares modulo 11. In particular, 6 is not.
  15. Given x and m, use Euclid to find r and s with r.x + s.m = 1 (if possible). The r ≡ x-1 (mod m).
  16. Use Russian multiplication and reduce the product modulo the base at each iteration.