Steply

Remainders

Mod · Discrete Math · 21 problems, easy to harder

▶ Watch the first one solved

How we do it

  1. Divide by 5
  2. On the clock
  3. Check

The steps for Calculate 17 mod 5. Every solution names its steps, so you always know what comes next.

Worked examples

Calculate 17 mod 5 Easy

The question

Question: work out 17 mod 5.

17 mod 5

Mod 5 means: the remainder after dividing by 5.

It is always a whole number from 0 to 4.

mod 5 = the remainder after ÷ 5
always 0 to 4

1 Divide by 5

Divide 17 by 5: 5 goes 3 times, that is 15, and 2 is left over.

17 = 5 × 3 + 2

Careful!

3 is how many times 5 goes in.

Mod asks for what is left over: 2.

Careful: not 17 mod 5 = 3 ✗

2 On the clock

Think of a clock with 5 numbers, 0 to 4.

So 17 mod 5 = 2.

17 mod 5 = 2

3 Check

Multiply back: 5 times 3, plus 2, is 17.

5 × 3 + 2 = 15 + 2 = 17

And 2 is from 0 to 4.

Right!

0 ≤ 2 < 5

Let's look back.

First: divide by 5.

Then: on the clock.

Last: check.

Answer
17 mod 5 = 2

▶ Watch it solved

Calculate -7 mod 3 Medium

The question

Question: work out −7 mod 3.

−7 mod 3

Mod 3 means: the remainder after dividing by 3.

It is always a whole number from 0 to 2.

mod 3 = the remainder after ÷ 3
always 0 to 2

1 Divide by 3

Divide −7 by 3.

For a negative number we go down to the multiple of 3 just below it: 3 × (−3) = −9.

Then up 2.

−7 = 3 × (−3) + 2

Careful!

A remainder is never negative.

We go down to the multiple just below, then count up.

Careful: not −7 mod 3 = −1 ✗

2 On the clock

Think of a clock with 3 numbers, 0 to 2.

So −7 mod 3 = 2.

−7 mod 3 = 2

3 Check

Multiply back: 3 times (−3), plus 2, is −7.

3 × (−3) + 2 = −9 + 2 = −7

And 2 is from 0 to 2.

Right!

0 ≤ 2 < 3

Let's look back.

First: divide by 3.

Then: on the clock.

Last: check.

Answer
−7 mod 3 = 2

▶ Watch it solved

Is 38 ≡ 14 (mod 6) Harder

The question

Question: is 38 ≡ 14 (mod 6)?

38 ≡ 14 (mod 6) ?

This sign means: they leave the same remainder when we divide by 6.

We say congruent.

≡ (mod n): the same remainder after ÷ n

1 Each remainder

Divide 38 by 6: 6 goes 6 times, that is 36, and 2 is left over.

38 = 6 × 6 + 2

14 is 6 × 2, plus 2.

14 = 6 × 2 + 2

Careful!

38 and 14 are different numbers.

The question is only about their remainders.

Careful: compare the remainders, not the numbers

2 Compare the remainders

Both leave 2.

The same remainder.

= 2 = 2

So yes: 38 ≡ 14 (mod 6).

= yes: 38 ≡ 14 (mod 6)

3 Check

Another way: the difference 24 is a multiple of 6.

Same remainders always give a difference that 6 goes into.

Right!

38 − 14 = 24 = 6 × 4

Let's look back.

First: each remainder.

Then: compare the remainders.

Last: check.

Answer
= yes: 38 ≡ 14 (mod 6)

▶ Watch it solved

Practice

Try each one, then open the answer. Stuck? Open the problem to watch every step.

Easy

  1. 17 mod 5
    Answer
    17 mod 5 = 2
  2. 23 mod 4
    Answer
    23 mod 4 = 3
  3. 30 mod 7
    Answer
    30 mod 7 = 2
  4. 9 mod 10
    Answer
    9 mod 10 = 9
  5. 40 mod 8
    Answer
    40 mod 8 = 0
  6. 45 mod 11
    Answer
    45 mod 11 = 1

Medium

  1. -7 mod 3
    Answer
    −7 mod 3 = 2
  2. -13 mod 5
    Answer
    −13 mod 5 = 2
  3. -20 mod 6
    Answer
    −20 mod 6 = 4
  4. 100 mod 7
    Answer
    100 mod 7 = 2
  5. (38 + 27) mod 5
    Answer
    5 = 5 × 1 + 0
  6. (38 × 27) mod 5
    Answer
    6 = 5 × 1 + 1
  7. (45 - 19) mod 6
    Answer
    = 2
  8. (123 × 456) mod 7
    Answer
    = 4
  9. (55 + 66) mod 9
    Answer
    = 4

Harder

  1. is 38 ≡ 14 (mod 6)
    Answer
    = yes: 38 ≡ 14 (mod 6)
  2. is 45 ≡ 17 (mod 7)
    Answer
    = yes: 45 ≡ 17 (mod 7)
  3. is 29 ≡ 5 (mod 8)
    Answer
    = yes: 29 ≡ 5 (mod 8)
  4. is -4 ≡ 11 (mod 5)
    Answer
    = yes: −4 ≡ 11 (mod 5)
  5. is 50 ≡ 21 (mod 4)
    Answer
    = no: different remainders mod 4
  6. (87 × 95) mod 11
    Answer
    70 = 11 × 6 + 4