There is a type of problem that looks terrifying at first glance: "Find the last digit of 7^{100}" or "What is the units digit of 13^{51}?" The numbers involved are astronomical — 7^{100} has 85 digits — so no calculator will save you. Students sometimes stare at the page, wondering if there is a trick.

There is, and it is the single most important reflex in school-level number theory: the last digit of an integer is its value mod 10. Translate every last-digit problem into modular arithmetic, and what looked impossible becomes a routine cycle-hunting exercise.

The switch: last digit = mod 10

For any non-negative integer n, the units (ones) digit of n is exactly n \bmod 10. This is not a theorem — it is a consequence of how decimal notation works. The number 1,234 is 1 \cdot 1000 + 2 \cdot 100 + 3 \cdot 10 + 4, and modding by 10 kills every term except the last, leaving 4.

So "find the last digit of X" and "find X \bmod 10" are the same problem. The moment you make this switch, you are out of the world of 85-digit numbers and into the world of single-digit arithmetic on residues.

Why: "mod 10" means "the remainder after dividing by 10." Since the rightmost decimal digit of any integer is exactly that remainder, last-digit problems are mod-10 problems wearing a disguise.

Why exponent towers still collapse

The reason mod 10 turns 7^{100} into a tractable problem is that the last digit of 7^n cycles with period 4. Watch:

7^1 = 7, \quad 7^2 = 49, \quad 7^3 = 343, \quad 7^4 = 2401, \quad 7^5 = 16807, \ldots

Their last digits: 7, 9, 3, 1, 7, 9, 3, 1, \ldots — a cycle of length 4. After every fourth multiplication by 7, you are back to a number ending in 7.

In mod-10 language: 7^4 \equiv 1 \pmod{10}. So 7^{4k} \equiv 1, 7^{4k+1} \equiv 7, 7^{4k+2} \equiv 9, 7^{4k+3} \equiv 3, for any k.

To find 7^{100} \bmod 10, divide the exponent by the cycle length: 100 = 4 \cdot 25 + 0. The remainder is 0, so 7^{100} \equiv 7^0 \cdot (7^4)^{25} \equiv 1 \pmod{10}. The last digit of 7^{100} is 1.

That is the entire trick.

Interactive: the last-digit cycle for bases 2 through 9

Drag the slider across bases $2$ to $9$. Every base's last-digit cycle has length $\leq 4$. That is why exponent towers in last-digit problems never become computationally hard — you only ever need the exponent modulo $4$ (or smaller).

The three-step recipe

Whenever you see a last-digit problem, run this procedure:

  1. Translate "last digit of X" to "X \bmod 10."
  2. Find the cycle of last digits for the base.
  3. Reduce the exponent mod the cycle length and look up the answer.

Let's apply it to a handful of JEE-style examples.

Problem 1. Find the last digit of 2^{2026}.

  1. Want: 2^{2026} \bmod 10.
  2. Cycle of 2^n mod 10: 2, 4, 8, 6, 2, 4, 8, 6, \ldots — length 4.
  3. 2026 \bmod 4 = 2. So look up position 2 in the cycle: that's 4.

Last digit: 4.

Problem 2. Find the last digit of 13^{51}.

The base 13 ends in 3. Since only the last digit of the base affects the last digit of the power, 13^{51} \equiv 3^{51} \pmod{10}.

  1. Want: 3^{51} \bmod 10.
  2. Cycle of 3^n mod 10: 3, 9, 7, 1, 3, 9, 7, 1, \ldots — length 4.
  3. 51 \bmod 4 = 3. Position 3 in the cycle: 7.

Last digit: 7.

Problem 3 (JEE level). Find the last digit of 7^{7^{7}}.

This is a tower. Strategy: the outermost last digit depends on the exponent 7^7 mod 4.

  1. Want: 7^{7^7} \bmod 10. The cycle of 7^n mod 10 has length 4, so we need 7^7 \bmod 4.
  2. Compute 7 \bmod 4 = 3, so 7^7 \equiv 3^7 \pmod 4. Then 3 \equiv -1 \pmod 4, so 3^7 \equiv (-1)^7 = -1 \equiv 3 \pmod 4. Thus 7^7 \equiv 3 \pmod 4.
  3. So 7^{7^7} \equiv 7^3 \equiv 343 \equiv 3 \pmod{10}.

Last digit: 3.

Notice how each level of the tower reduces to a different modulus. The outermost reduction is mod 10; the second is mod the cycle length (4); if there were a third level, it would reduce mod the order of the exponent mod 4. This is the Chinese-remainder-theorem-like cascade that makes huge towers tractable.

Why the cycles are always short

A theorem guarantees this: by Euler's theorem, if \gcd(a, 10) = 1, then a^{\phi(10)} \equiv 1 \pmod{10} where \phi(10) = 4. So every base coprime to 10 — that is, bases ending in 1, 3, 7, 9 — has cycle length dividing 4. For bases ending in even digits or 5, the cycles are even shorter (or degenerate to fixed points: 5^n and 6^n always end in 5 and 6 respectively).

Bottom line: in mod 10, nothing with a coprime base takes longer than 4 steps to cycle. Every last-digit problem is therefore a tiny, bounded computation — no matter how tall the exponent tower.

The reflex lives well beyond "last digit"

Once you internalise the switch to mod 10, you start recognising the same trick elsewhere:

Every "divisibility flavour" problem is a mod problem in disguise. The last-digit reflex is your first exposure to the general pattern — the most natural place to build the habit.

One-line takeaway

The last digit of any integer is its value mod 10. Whenever you see "find the last digit of a^n," switch to mod 10, find the (at most length-4) cycle of a^k \bmod 10, reduce n mod the cycle length, and read off the answer. Huge exponents become tiny table lookups.

Related: Number Theory Basics · Factor Into Primes First · gcd = 1 Signals Bézout and Modular Inverses · Why HCF × LCM Works · Coprime vs Prime