Steply

Calculate 23 mod 4

Step by step, with the reason for every step · Remainders · Discrete Math

Step by step

The question

Question: work out 23 mod 4.

23 mod 4

Mod 4 means: the remainder after dividing by 4.

It is always a whole number from 0 to 3.

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

1 Divide by 4

Divide 23 by 4: 4 goes 5 times, that is 20, and 3 is left over.

23 = 4 × 5 + 3

Careful!

5 is how many times 4 goes in.

Mod asks for what is left over: 3.

Careful: not 23 mod 4 = 5 ✗

2 On the clock

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

So 23 mod 4 = 3.

23 mod 4 = 3

3 Check

Multiply back: 4 times 5, plus 3, is 23.

4 × 5 + 3 = 20 + 3 = 23

And 3 is from 0 to 3.

Right!

0 ≤ 3 < 4

Let's look back.

First: divide by 4.

Then: on the clock.

Last: check.

Answer
23 mod 4 = 3

Your turn

Try this one yourself, then check:

26 mod 3
Show the answer
26 mod 3 = 2

More from Remainders

The whole lesson: Remainders →