How to Find the Last Digit Using Cyclicity of Numbers
Learn cyclicity of numbers to find the last digit of any large power using cycle length and modular reduction, with worked examples and practice.
Expected Interview Answer
Cyclicity is the fact that the last digit of a^n repeats in a short, predictable pattern as n increases, so the last digit of any power can be found by reducing the exponent modulo the cycle length instead of computing the full power.
Every digit 0-9 has a cycle length of 1, 2, or 4 for its last digit under repeated multiplication: digits 0, 1, 5, 6 have cycle length 1 (last digit never changes), digits 4 and 9 have cycle length 2, and digits 2, 3, 7, 8 have cycle length 4. To find the last digit of a^n, take the last digit of the base, find its cycle length c, compute r = n mod c (using c instead of 0 when the remainder is 0), and the answer is the r-th value in that digit’s cycle. This turns an enormous exponentiation into a small lookup, which is exactly why it is a fast aptitude and interview technique.
- Avoids computing astronomically large powers directly
- Only requires knowing 4 short cycles (length 1, 2, 4, 4) to cover all ten digits
- Extends directly to finding last two digits with more advanced cyclicity tables
AI Mentor Explanation
A bowler’s over always cycles through exactly 6 balls before the field positions and bowling end reset, no matter how many overs are bowled in the match — the pattern of 'which ball number in the over' repeats every 6 deliveries. Finding the last digit of a large power works the same way: the last digit repeats in a fixed cycle length (1, 2, or 4 depending on the digit), so instead of tracking every delivery in a 90-over match, you just find the remainder when the ball count is divided by 6. Cyclicity of numbers is this same shortcut — reduce the huge exponent modulo the cycle length and read off the position.
Worked example
Cycle for 7
- 7,9,3,1 (length 4)
Reduce exponent
- 123 mod 4 = 3
Lookup
- 3rd value = 3
Step-by-Step Explanation
Step 1
Isolate the last digit of the base
Only the base's last digit determines the result's last digit.
Step 2
Find its cycle length
0,1,5,6 → length 1; 4,9 → length 2; 2,3,7,8 → length 4.
Step 3
Reduce the exponent
Compute r = n mod cycle length; if r = 0, use the cycle length itself instead.
Step 4
Read off the answer
The r-th value in that digit's cycle is the last digit of the power.
What Interviewer Expects
- Knowing the correct cycle length for each digit group (1, 2, or 4)
- Correctly handling the edge case when the exponent mod cycle length is 0
- Isolating the base's last digit before applying cyclicity
- Ability to extend the concept qualitatively to last-two-digit problems
Common Mistakes
- Using the full base number instead of just its last digit
- Forgetting to substitute the cycle length itself when the remainder is 0
- Misremembering cycle lengths, e.g., treating 2 as cycle length 2 instead of 4
- Applying cyclicity logic to addition/subtraction problems where it does not apply
Best Answer (HR Friendly)
“The last digit of any power repeats in a short cycle — length 1, 2, or 4 depending on the digit. So instead of computing a massive power, I just take the base’s last digit, find its cycle, divide the exponent by the cycle length, and use the remainder to look up the answer directly. It turns an impossible-by-hand computation into a two-step lookup.”
Follow-up Questions
- How would you find the last two digits of a large power instead of just the last digit?
- Why do digits 0, 1, 5, and 6 always have cycle length 1?
- How does cyclicity help in finding the remainder of a power divided by 10?
- How would you find the last digit of a sum of several large powers?
MCQ Practice
1. What is the last digit of 8^50?
Cycle of 8 is 8,4,2,6 (length 4). 50 mod 4 = 2, so the 2nd value is 4.
2. What is the last digit of 6^999?
Digit 6 has cycle length 1 — the last digit of any power of 6 is always 6.
3. What is the cycle length of the last digit of powers of 9?
9^1=9, 9^2=81, 9^3=729, 9^4=6561 — last digits 9,1,9,1, repeating every 2 steps.
Flash Cards
Cycle length for digits 0,1,5,6? — 1 — last digit never changes.
Cycle length for digits 4,9? — 2.
Cycle length for digits 2,3,7,8? — 4.
What to do when n mod cycle length = 0? — Use the cycle length itself as the position, not 0.