Compute the last digit of 7^{1}, 7^{2}, 7^{3}, 7^{4} by hand:
Last digits: 7, 9, 3, 1. Now watch what happens at 7^5:
Last digit: 7. You are back where you started. The last digit of 7^n cycles through the four values 7, 9, 3, 1 forever, in that order, with period 4.
This is not a coincidence or a quirk of the number 7. It is the general behaviour of powers modulo 10, and the cycle length (always at most 4 for last-digit problems) is what makes "find the last digit of 7^{123456}" answerable without a calculator.
Drag the exponent, watch the cycle
Why the cycle has length 4
The last digit of any integer k is k \bmod 10. So you are really computing 7^n \bmod 10. Walk through the powers one by one, reducing mod 10 after each multiplication:
| n | 7^n | Last digit | Note |
|---|---|---|---|
| 1 | 7 | 7 | start |
| 2 | 49 | 9 | 7 \times 7 = 49 \equiv 9 |
| 3 | 343 | 3 | 9 \times 7 = 63 \equiv 3 |
| 4 | 2401 | 1 | 3 \times 7 = 21 \equiv 1 |
| 5 | 16807 | 7 | 1 \times 7 = 7 — back to start |
The key step happens at n = 4: the last digit becomes 1. Once a power hits 1 \pmod {10}, multiplying by 7 again gives 7 — the same value you had at n = 1. From that moment, the entire sequence has to repeat exactly, because each term depends only on the previous one.
Why the cycle must close as soon as 1 appears: 7^{n+1} = 7 \cdot 7^n. If 7^n \equiv 1 \pmod{10} then 7^{n+1} \equiv 7 \pmod{10}, which is where the cycle started. So the sequence is deterministic once the sequence contains 1, and it will replay the same four values forever.
The rule: the exponent mod 4 is all that matters
Once you know the cycle length is 4, the last-digit problem reduces to a division. To find the last digit of 7^n, compute n \bmod 4:
- n \equiv 1 \pmod 4: last digit 7
- n \equiv 2 \pmod 4: last digit 9
- n \equiv 3 \pmod 4: last digit 3
- n \equiv 0 \pmod 4: last digit 1
For n = 100: 100 = 4 \times 25 + 0, so 100 \equiv 0 \pmod 4, and the last digit of 7^{100} is \boxed{1}.
For n = 2025: 2025 = 4 \times 506 + 1, so 2025 \equiv 1 \pmod 4, and the last digit of 7^{2025} is \boxed{7}.
For n = 10^{18}: even powers of 10 are divisible by 4 (since 100 = 4 \times 25), so 10^{18} \equiv 0 \pmod 4 and the last digit is 1.
Why every digit base shows some cycle
The digit 7 is not special. Repeat the experiment with any base b \in \{0, 1, 2, \dots, 9\}:
| Base b | Cycle of last digits | Length |
|---|---|---|
| 0 | 0, 0, 0, 0, \dots | 1 |
| 1 | 1, 1, 1, 1, \dots | 1 |
| 2 | 2, 4, 8, 6, 2, \dots | 4 |
| 3 | 3, 9, 7, 1, 3, \dots | 4 |
| 4 | 4, 6, 4, 6, \dots | 2 |
| 5 | 5, 5, 5, \dots | 1 |
| 6 | 6, 6, 6, \dots | 1 |
| 7 | 7, 9, 3, 1, 7, \dots | 4 |
| 8 | 8, 4, 2, 6, 8, \dots | 4 |
| 9 | 9, 1, 9, 1, \dots | 2 |
Every single digit produces a short cycle — at most length 4. There are only 10 possible last digits, so by the pigeonhole principle the sequence b, b^2, b^3, \dots mod 10 must repeat some value within the first 11 terms. And once any value repeats, the whole tail from that point on repeats with it.
More precisely, for bases coprime to 10 (the bases 1, 3, 7, 9), Euler's theorem guarantees b^4 \equiv 1 \pmod {10}, because Euler's totient \phi(10) = 4. That theorem is what sets the maximum cycle length at 4 for all four coprime bases. Bases sharing a factor with 10 (namely 2, 4, 5, 6, 8) do not hit 1, but they still settle into a cycle — they just do not return to their starting digit until later.
One worked example
Find the last digit of $7^{2026} + 3^{2026}$.
Step 1. Find the last digit of 7^{2026}.
Compute 2026 \bmod 4: 2026 = 4 \times 506 + 2, so 2026 \equiv 2 \pmod 4.
Position 2 in the cycle 7, 9, 3, 1 is 9. So 7^{2026} ends in 9.
Why: 2026 = 4 \times 506 + 2 means 7^{2026} = (7^4)^{506} \times 7^2. Since 7^4 \equiv 1 \pmod{10}, the whole thing reduces to 7^2 \equiv 9 \pmod{10}.
Step 2. Find the last digit of 3^{2026}.
The cycle for 3 is also 3, 9, 7, 1 (check: 3, 9, 27 \to 7, 81 \to 1, then 3, 9, 7, 1, \dots). Position 2 is 9. So 3^{2026} also ends in 9.
Step 3. Add and take the last digit.
9 + 9 = 18, which ends in 8. So the last digit of 7^{2026} + 3^{2026} is \boxed{8}.
Why you can add last digits: mod 10 respects addition. If 7^{2026} \equiv 9 and 3^{2026} \equiv 9, then 7^{2026} + 3^{2026} \equiv 9 + 9 = 18 \equiv 8 \pmod{10}. The sum of the two gigantic numbers has last digit 8 without needing to know the rest.
The one-sentence takeaway
The last digits of 7^n are completely determined by n \bmod 4, cycling 7 \to 9 \to 3 \to 1 forever. Every last-digit problem in JEE, RMO, or NTSE reduces to this trick: find the cycle (by computing a handful of powers), then reduce the exponent modulo the cycle length. The exponent may be astronomical — the cycle is always short.
Related: Modular Arithmetic · Last Digit Problems — Switch to Mod 10 · Divisibility Rules as Modular Shortcuts · Number Line Wrapping into a Circle · Number Theory Basics