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
aqbr1224=?·192+??=?·?+??=?·?+??=?·?+?

Use Euclid’s algorithm to find gcd(1224, 192).

a = 1224b = 192
gcd(1224, 192) =
2.Easy
012mod 3

Find 913 mod 3, the remainder r with 0 ≤ r < 3.

a = 913n = 3
913 mod 3 =
3.Medium

Find the smallest positive integer x with x ≡ 1 (mod 3) and x ≡ 0 (mod 11).

x ≡ 1 (mod 3)x ≡ 0 (mod 11)
x =
4.Medium

Find Euler’s totient φ(847), the number of integers from 1 to 847 that are coprime to 847.

n = 847 = 7·112
φ(847) =
5.Hard
mc = me​ mod n519m = cd​ mod n?(n, e) = (1073, 11)d

An RSA key uses p = 29, q = 37 and e = 11. Decrypt the ciphertext c = 519: find the message m.

p = 29q = 37e = 11c = 519
m =
6.Hard
mc = me​ mod ncm = cd​ mod nm(n, e) = (203, 17)d = ?

An RSA key uses the primes p = 7 and q = 29 and the public exponent e = 17. Find the private exponent d (0 < d < φ(n)).

p = 7q = 29e = 17
d =

Answer key

  1. 1. gcd(1224, 192) = 24
  2. 2. 913 mod 3 = 1
  3. 3. x = 22
  4. 4. φ(847) = 660
  5. 5. m = 630
  6. 6. d = 89

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