Step by step
The question
Question: find 2²⁰ mod 3.
2 to the power 20 has 7 digits.
Too big to work out by hand.
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.
2 to the 1 is 2.
Then 2 times 2 is 4.
4 mod 3 is 1.
And so on.
2 Find the pattern
At k = 3 we are back to 2.
From here everything repeats.
So the pattern 2, 1 repeats every 2 powers.
3 Where 20 lands
20 divided by 2: 10 full patterns, and 0 left over.
Careful!
Nothing left over means we end at the end of a pattern: the same place as k = 2.
So 2 to the 20 is like k = 2: the last one of the pattern.
So 2²⁰ mod 3 is 1.
4 Check
A computer can work out all 7 digits: 1048576.
Divided by 3, it leaves 1, the same as our pattern.
Right!
Let's look back.
First: small powers first.
Then: find the pattern.
Then: where 20 lands.
Last: check.