Overview
Many contest problems ask for the units digit, or last digit, of a very large number.
For example:
is far too large to work out directly. However, its units digit is easy to find because powers of have a repeating last-digit pattern.
Units digit periodicity is the idea that powers of any integer eventually repeat in their units digits. This is really modular arithmetic modulo .
Instead of studying the entire number, we only study its remainder modulo .
Motivation
Consider the powers of :
The units digits are
Now multiply by another :
has the same units digit as
So the pattern repeats:
This means we do not need to compute . We only need to know where falls in the repeating cycle.
Since the cycle length is and
the units digit is the second digit in the cycle:
Units Digits and Modulo
The units digit of an integer is its remainder when divided by .
For example,
so the units digit of is .
As such finding the units digit of a number is the same as finding the number modulo .
For powers, this means
determines the units digit of .
Reducing the Base
When finding the units digit of a power, only the units digit of the base matters.
For example,
has the same units digit as
because
So before doing anything else, reduce the base modulo .
Why Cycles Appear
There are only ten possible units digits:
When we repeatedly multiply by the same base and only keep track of the units digit, we have to eventually repeat a digit.
Once a digit repeats in the same position of the multiplication process, the cycle continues forever.
For units digit problems, these cycles are usually very short.
Common Units Digit Cycles
The following cycles are worth knowing.
Powers Ending in
If a number ends in , then every positive power also ends in :
Powers Ending in
If a number ends in , then every positive power also ends in :
Powers Ending in
The units digits cycle as
Powers Ending in
The units digits cycle as
Powers Ending in
The units digits cycle as
Powers Ending in
If a number ends in , then every positive power also ends in :
Powers Ending in
If a number ends in , then every positive power also ends in :
Powers Ending in
The units digits cycle as
Powers Ending in
The units digits cycle as
Powers Ending in
The units digits cycle as
Using the Cycle Length
Once we know the cycle, we reduce the exponent modulo the cycle length.
For example, the powers of have units digit cycle
This cycle has length .
To find the units digit of
we compute
A remainder of means we use the last digit in the cycle, not the first.
Therefore, the units digit is
This is a common source of mistakes.
Worked Examples
Example 1
Find the units digit of
The powers of have units digit cycle
The cycle length is .
Now
So we take the second digit in the cycle.
Therefore, the units digit is
Example 2
Find the units digit of
First reduce the base:
So we need the units digit of
The powers of have cycle
The cycle length is , and
So we take the first digit in the cycle.
Therefore, the units digit is
Example 3
Find the units digit of
First, find the units digit of
The powers of cycle as
Since
the units digit of is
Now find the units digit of
The powers of cycle as
Since
the units digit of is
Therefore, the units digit of the sum is the units digit of
So the final units digit is
Example 4
Find the units digit of
First reduce the bases:
and
So we need the units digit of
For , the cycle is
Since
the units digit of is
For , the cycle is
Since
the units digit of is
Thus the units digit of the product is the units digit of
So the units digit is
Example 5
Find the units digit of
The powers of have cycle
with cycle length .
So we need to know the exponent
modulo .
Since
we have
Therefore, the exponent leaves remainder modulo .
So
has the same units digit as the first term in the cycle for powers of .
Thereofre the units digit is
Expressions With Sums and Products
When an expression contains several large powers, find the units digit of each part separately.
For sums, add the resulting units digits and reduce modulo .
For products, multiply the resulting units digits and reduce modulo .
For example, if one term has units digit and another has units digit , then their product has units digit equal to the units digit of
which is
Higher Powers in the Exponent
Sometimes the exponent itself is large, such as in
In such problems, first find the cycle length of the base.
The powers of have cycle length :
So we need the exponent modulo .
Then compute
Since
we get
Therefore, the exponent corresponds to the first position in the cycle, so the units digit of
is
Key Contest Insight
Units digit problems are modular arithmetic problems modulo .
The main steps are:
- Reduce the base modulo
- Identify the repeating cycle
- Reduce the exponent modulo the cycle length
- Choose the correct position in the cycle
- Combine units digits carefully for sums or products
The most important detail is how to handle exponent remainders. If the exponent is divisible by the cycle length, use the last digit of the cycle.
Strategy Tips
- Reduce the base to its units digit first
- Memorise the short cycles for digits through
- For cycles of length , reduce the exponent modulo
- For cycles of length , reduce the exponent modulo
- If the exponent is itself large, reduce it modulo the cycle length
- For a remainder of , use the final term of the cycle
- Treat sums and products by combining units digits at the end
Common Pitfalls
- Using the first term of a cycle when the exponent is divisible by the cycle length
- Forgetting to reduce the base modulo
- Trying to compute the full power instead of using the cycle
- Mixing up the cycles for and
- Forgetting to reduce the exponent modulo the cycle length
- In expressions with several terms, combining the bases before finding their units digits
Practice Problems
| Status | Source | Problem Name | Difficulty | Tags | ||
|---|---|---|---|---|---|---|
Module Progress:
Join the Discord Community!
Stuck on a problem, or don't understand a module? Join the Discord and get help with your doubts while making more math friends.
