Steply

Remainder when 2^100 is divided by 5

Step by step, with the reason for every step · Powers mod n, last digits · Discrete Math

Step by step

The question

Question: find 2¹⁰⁰ mod 5.

2100 mod 5

2 to the power 100 has 31 digits.

Too big to work out by hand.

2100 has 31 digits!

1 Small powers first

Let's make a table of small powers.

Each one is the one before times 2.

We only keep the remainder: the big part never matters.

only the remainder matters

2 to the 1 is 2.

2
2

Then 2 times 2 is 4.

2 × 2 = 4

4 mod 5 is 4.

And so on.

4
4 × 2 = 8
3
3 × 2 = 6
1
1 × 2 = 2
2

2 Find the pattern

At k = 5 we are back to 2.

From here everything repeats.

So the pattern 2, 4, 3, 1 repeats every 4 powers.

repeats every 4: 2, 4, 3, 1, 2, 4, 3, 1, ...

3 Where 100 lands

100 divided by 4: 25 full patterns, and 0 left over.

100 = 4 × 25 + 0

Careful!

Nothing left over means we end at the end of a pattern: the same place as k = 4.

Careful: not k = 0 ✗

So 2 to the 100 is like k = 4: the last one of the pattern.

So 2¹⁰⁰ mod 5 is 1.

2100 mod 5 = 1

4 Check

A computer can work out all 31 digits: 126765, and so on, 5376.

computer: 2100 = 126765...5376

Divided by 5, it leaves 1, the same as our pattern.

Right!

÷ 5: remainder 1

Let's look back.

First: small powers first.

Then: find the pattern.

Then: where 100 lands.

Last: check.

Answer
2100 mod 5 = 1

Your turn

Try this one yourself, then check:

434 mod 5
Show the answer
4³⁴ mod 5 = 1

More from Powers mod n, last digits

The whole lesson: Powers mod n, last digits →