Number theory & modular arithmetic worksheet with answers

Free printable Number theory & modular arithmetic worksheet: 6 problems from easy to exam level, with an answer key. Print it or save it as a PDF.

For teachers: free to print, copy and use in class. Every new worksheet has new values and its own answer key. A link to ExamProblems on your course page is appreciated.

Name: ____________________   Date: ____________

1.Easy

Find (777·217 + 391) mod 7 without multiplying out the large numbers: reduce first.

n = 7
(777·217 + 391) mod 7 =
2.Easy
aqbr495=?·77+??=?·?+??=?·?+?

Use Euclid’s algorithm to find gcd(495, 77).

a = 495b = 77
gcd(495, 77) =
3.Medium

Find the smallest positive integer x with x ≡ 7 (mod 8) and x ≡ 8 (mod 9).

x ≡ 7 (mod 8)x ≡ 8 (mod 9)
x =
4.Medium

Find the inverse of 66 modulo 71: the number x with 0 < x < 71 and 66·x ≡ 1 (mod 71).

a = 66n = 71
66−1 mod 71 =
5.Hard
mc = me​ mod n417m = cd​ mod n?(n, e) = (1147, 17)d

An RSA key uses p = 31, q = 37 and e = 17. Decrypt the ciphertext c = 417: find the message m.

p = 31q = 37e = 17c = 417
m =
6.Hard

How many solutions N does 42x ≡ 40 (mod 44) have in {0, 1, …, 43}?

42x ≡ 40 (mod 44)
N =

Answer key

  1. 1. (777·217 + 391) mod 7 = 6
  2. 2. gcd(495, 77) = 11
  3. 3. x = 71
  4. 4. 66−1 mod 71 = 14
  5. 5. m = 359
  6. 6. N = 2

Full step-by-step solutions: practise this topic on examproblems.com.