Steply

Calculate 2^35 mod 9

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 9.

235 mod 9

2 to the power 35 has 11 digits.

Too big to work out by hand.

235 has 11 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 9 is 4.

And so on.

4
4 × 2 = 8
8
8 × 2 = 16
7
7 × 2 = 14
5
5 × 2 = 10
1
1 × 2 = 2
2

2 Find the pattern

At k = 7 we are back to 2.

From here everything repeats.

So the pattern 2, 4, 8, 7, 5, 1 repeats every 6 powers.

repeats every 6: 2, 4, 8, 7, 5, 1, 2, 4, 8, 7, 5, 1, ...

3 Where 35 lands

35 divided by 6: 5 full patterns, and 5 left over.

35 = 6 × 5 + 5

Careful!

The pattern is all we need.

The full number is far too big.

Careful: never work out 2³⁵ itself

So 2 to the 35 is like k = 5.

So 2³⁵ mod 9 is 5.

235 mod 9 = 5

4 Check

A computer can work out all 11 digits: 34359738368.

computer: 235 = 34359738368

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

Right!

÷ 9: remainder 5

Let's look back.

First: small powers first.

Then: find the pattern.

Then: where 35 lands.

Last: check.

Answer
235 mod 9 = 5

Your turn

Try this one yourself, then check:

735 mod 9
Show the answer
7³⁵ mod 9 = 4

More from Powers mod n, last digits

The whole lesson: Powers mod n, last digits →