Skip to content
Matheminate
TopicsProgressWorksheetsGamesLabToolsAbout
Home/OlympiadMath Olympiad Practice/The Last Digit Loop
Number TheoryIntermediate

The Last Digit Loop

Skill: replacing a huge calculation with a repeating cycle

Problem

What is the last digit of 7²⁰²⁶?

You do not need a calculator. In fact, no ordinary calculator can show that number.

Hints

Hint 1

Do not compute 7²⁰²⁶. Compute 7¹, 7², 7³, 7⁴ and write down only the last digit of each.

Hint 2

The last digits run 7, 9, 3, 1, and then they start again. How many steps are there before the repeat?

Hint 3

2026 divided by 4 leaves remainder 2, so 7²⁰²⁶ lands in the same place in the cycle as 7².

Solution

  1. 1

    Write the first few powers.

    7¹ = 7, 7² = 49, 7³ = 343, 7⁴ = 2401, 7⁵ = 16807. Only the last digit matters, so keep just 7, 9, 3, 1, 7. The fifth power already repeats the first, which is the clue that the pattern will keep going.

  2. 2

    Explain why the loop must close.

    The last digit of a product depends only on the last digits of the factors. To get the next last digit, you only need the current one: 7 gives 9, 9 gives 3, 3 gives 1, and 1 gives 7. Since there are only ten possible last digits, the sequence must eventually return to a digit it has already used. For powers of 7 it returns after four steps, and from that point the loop is forced.

  3. 3

    Line the powers up with their positions.

    The cycle has length 4. Exponent 1 gives last digit 7, exponent 2 gives 9, exponent 3 gives 3, and exponent 4 gives 1. Exponent 5 is back to 7. So the last digit is decided by the exponent's remainder when divided by 4, not by how large the exponent is.

  4. 4

    Divide the exponent.

    2026 = 4 × 506 + 2, so the remainder is 2. A remainder of 1 means the first entry, 7; a remainder of 2 means the second, 9; a remainder of 3 means the third, 3; and a remainder of 0 means the fourth, 1.

  5. 5

    Read off the answer.

    Remainder 2 gives 9, so the last digit of 7²⁰²⁶ is 9. A common slip is to treat remainder 0 as 0. It is not zero but the fourth entry, because exponents 4, 8, 12 and so on all give 1.

Answer: 9.

Why this works

The loop exists because the next last digit depends on nothing except the current one. Each multiplication by 7 maps one of the ten digits to another, and a finite set of digits must repeat when the same map is applied again and again.

You never need the size of 7²⁰²⁶, only its position in the four-step cycle. The remainder is the position, which is why the whole calculation fits in one line.

Try a related problem

What is the last digit of 3²⁰²⁵?

3. The last digits of the powers of 3 run 3, 9, 7, 1 and then repeat: 3¹ = 3, 3² = 9, 3³ = 27, 3⁴ = 81, 3⁵ = 243. The cycle also has length 4. Since 2025 = 4 × 506 + 1, it sits in the same position as 3¹, so the last digit is 3. Cycle lengths differ by base: for 2 the digits run 2, 4, 8, 6, while for 5 every power ends in 5, a cycle of length 1.

← All Olympiad problems

Matheminate

Free math practice for Grades 4–12.

© 2026 Matheminate. All rights reserved.

Practice

  • Topics
  • Interactive Lab
  • Math Articles
  • Olympiad Practice

Site

  • About
  • Contact
  • Support
  • Privacy
  • Terms

Follow

  • Instagram
  • X