PYQ Vault

CDS Mathematics · Number System

Unit Digit & Cyclicity

The last digit of a power depends only on the last digit of the base and on the exponent's remainder modulo 4, so an enormous power can be settled in two lines of arithmetic.

Why this matters

Thirteen PYQs and among the most reliable marks in CDS Elementary Mathematics — six of the thirteen are EASY and every one of those is a thirty-second question once the cycle table is memorised. The two HARD ones are the same technique pushed one step further: instead of one power you are asked how many different last digits a sum of several powers can produce.

Concept 1 of 5

The unit-digit cycle of each base

Intuition

Multiply a number by itself repeatedly and watch only the last digit: it never wanders. It falls into a short repeating loop, and the loop length is 1, 2 or 4 for every possible last digit. Nothing else can happen, because there are only ten possible last digits and multiplication by the base is deterministic.

Definition

Only the last digit of the base matters, so 67n67^{n} and 7n7^{n} always end in the same digit. Each last digit has a fixed cycle:

  • Period 1 (the digit never changes): 0, 1, 5, 6.
  • Period 2: 4 and 9.
  • Period 4: 2, 3, 7 and 8.

Because every period divides 4, reducing the exponent modulo 4 is enough for all bases — which is why one rule covers the whole table.

Last digit of baseCycle of unit digitsPeriod
001
111
22, 4, 8, 64
33, 9, 7, 14
44, 62
551
Every positive power of a number ending in 5 ends in 5. There is no alternation.
661
77, 9, 3, 14
88, 4, 2, 64
99, 12
Read the cycle left to right starting at exponent 1. Every period divides 4, so exponent modulo 4 settles every case.
Practice this conceptself-check · 4 quick reps

From the bank · past-year question

Example 1Number SystemEASY
What is the unit place digit in the expansion of 7737^{73} ?

[Q19 · CDS (II) 2019 — Elementary Mathematics · 2019]

The base's other digits are irrelevant, and the exponent's are not

673267^{32}, 7327^{32} and 1257321257^{32} all end in the same digit — only the base's last digit counts. But you must use the whole exponent when reducing modulo 4: the exponent's last digit alone is not enough, since 1414 and 3434 end alike yet leave different remainders on division by 4.

Concept 2 of 5

Reducing the exponent modulo 4

Intuition

If the cycle has length 4, then walking 4 steps brings you back where you started — so only the exponent's remainder on division by 4 decides the answer. The one place this goes wrong is a remainder of zero: that means you have just completed a lap, so you land on the last entry of the cycle, not the first.

Definition

To find the unit digit of bnb^{n}:

  • take dd, the last digit of bb, and look up its cycle;
  • compute r=nmod4r = n \bmod 4;
  • if r{1,2,3}r \in \{1,2,3\}, take the rr-th entry of the cycle; if r=0r = 0, take the last entry.

For a period-2 base (4 or 9) the shortcut is simply the parity of nn: odd exponent gives the first entry, even the second.

Exponent reduction

bn ends in the r-th cycle entry,r=nmod4    (r=04th entry)b^{n} \text{ ends in the } r\text{-th cycle entry}, \quad r = n \bmod 4 \;\;(r=0 \Rightarrow \text{4th entry})
7n ≡ 19n ≡ 23n ≡ 317⁴n ≡ 0cycle length 4multiply by 7

The unit digit of 7ⁿ depends only on n mod 4. The amber node is the trap: a remainder of 0 means the lap just finished, so 7⁴, 7⁸, 7³² all land on 1 — the last node, never the first.

Worked example

What is the unit digit of 320263^{2026}?
Practice this conceptself-check · 4 quick reps

From the bank · past-year question

Example 2Number SystemEASY
What is the unit digit of 71397^{139} ?

[Q33 · CDS (II) 2016 — Elementary Mathematics · 2016]

A remainder of 0 sends you to the END of the cycle, not the start

This is the single commonest error in the whole subtopic. 21002^{100} has 100mod4=0100 \bmod 4 = 0, and the answer is 6 — the fourth entry — not 2. Think of it as finishing a lap: remainder 0 means you are standing on the last step, and the amber node in the diagram above is exactly that position.

Reduce the exponent modulo 4, never modulo 10

The cycle length is 4, so 4 is the modulus for the exponent. Students who reduce the exponent modulo 10 — because the question is about the last digit — get a number between 0 and 9 that means nothing here. The 10 lives in the answer; the 4 lives in the exponent.

Concept 3 of 5

Unit digits of sums, differences and products of powers

Intuition

Last digits behave well under every arithmetic operation: to get the last digit of a sum, add the last digits and keep only the last digit of that. So a frightening expression becomes a handful of one-digit sums. For a difference, borrow 10 if the first digit is smaller.

Definition

Work modulo 10 throughout, since the last digit is the residue modulo 10.

  • Sum: add the individual unit digits, then reduce modulo 10.
  • Product: multiply the individual unit digits, then reduce modulo 10.
  • Difference: subtract; if the result is negative add 10.

For an expression like 3983893^{98}-3^{89}, factor out the smaller power first389(391)3^{89}(3^{9}-1) — and then take unit digits of each factor, because subtracting before factoring invites a sign slip.

Unit digit of a combination

(A±B)mod10=[(Amod10)±(Bmod10)]mod10(A \pm B) \bmod 10 = \big[(A \bmod 10) \pm (B \bmod 10)\big] \bmod 10

Worked example

How many distinct unit digits can 2a+3b2^{a} + 3^{b} take, for natural numbers aa and bb?
Practice this conceptself-check · 4 quick reps

From the bank · past-year question

Example 3Number SystemEASY
What is the last digit of the sum S=927+279S = 9^{27} + 27^9 ?

[Q38 · CDS (I) 2023 — Elementary Mathematics · 2023]

Factor a difference of powers before taking unit digits

For 3983893^{98}-3^{89}, taking each term's unit digit gives 939-3 and the tempting answer 6 — which happens to be right here, but the method is unsafe: it breaks whenever the first unit digit is the smaller. Factoring to 389(391)3^{89}(3^9-1) turns it into a product, which never needs borrowing.

A negative difference needs plus 10, not a minus sign

If the unit digits give 47=34-7=-3, the last digit is 77, not 3-3 or 33. Add 10 once. A digit is always in the range 0 to 9.

Concept 4 of 5

A number that is odd and a multiple of 5 must end in 5

Intuition

Multiples of 5 end in 0 or 5, and nothing else. If the number is also odd, 0 is impossible — so it ends in 5. This one-line argument replaces a lot of work: a long product of odd numbers that includes a 5 somewhere has last digit 5, however many factors there are.

Definition

A number is a multiple of 5 exactly when its unit digit is 00 or 55; and it is even exactly when its unit digit is even.

  • Odd and a multiple of 5 \Rightarrow it ends in 55.
  • A product of integers is odd only when every factor is odd, and is a multiple of 5 as soon as one factor is.

So for a product: if every factor is odd and at least one carries a factor of 5, the last digit is 55. If any factor is even and one carries a 5, the last digit is 00.

Odd multiple of five

5N  and  N odd    N5(mod10)5 \mid N \;\text{and}\; N \text{ odd} \;\Longrightarrow\; N \equiv 5 \pmod{10}

Worked example

What is the unit digit of the product of all odd numbers from 21 to 39 inclusive?
Practice this conceptself-check · 4 quick reps

From the bank · past-year question

Example 4Number SystemEASY
What is the digit in the unit place of the number 11×33×55×77×991^1 \times 3^3 \times 5^5 \times 7^7 \times 9^9 ?

[Q30 · CDS (I) 2026 — Elementary Mathematics · 2026]

The word ODD in the question is what changes the answer from 0 to 5

"The product of all odd primes up to 110" ends in 5; "the product of all primes up to 110" ends in 0, because including 2 makes the product even. CDS sets both versions. The single word doing the work is odd, and it is easy to read past.

Concept 5 of 5

Counting how many unit digits an expression can produce

Intuition

When several exponents are free to vary independently, the question stops being "what is the last digit" and becomes "how many last digits are reachable". The method is to collapse the constant terms first, then enumerate only the terms that actually move — usually just two short cycles, so sixteen cases at most.

Definition

Procedure:

  • Reduce each base modulo 10 and identify its cycle.
  • Fix the constant terms. A base ending in 0, 1, 5 or 6 has period 1, so it contributes the same digit always and can be added in once.
  • Enumerate the Cartesian product of the remaining cycles and collect the distinct residues.
  • A parity argument often shortcuts the count: if the expression is forced even, at most the five even digits are reachable.

Number of cases to check

cases=moving terms(period of that term)\text{cases} = \prod_{\text{moving terms}} (\text{period of that term})

Worked example

How many distinct unit digits can 6a+2b6^{a} + 2^{b} take, for natural numbers aa and bb?
Practice this conceptself-check · 4 quick reps

From the bank · past-year question

Example 5Number SystemHARD
Let S=5a+7b+11c+13dS = 5^a + 7^b + 11^c + 13^d, where aa, bb, cc and dd are natural numbers. What is the number of distinct remainders of SS when it is divided by 10 ?

[Q99 · CDS (II) 2024 — Elementary Mathematics · 2024]

Collapse the period-1 terms before you start enumerating

In 5a+7b+11c+13d5^{a}+7^{b}+11^{c}+13^{d} two of the four terms never change: 5a5^a ends in 5 and 11c11^c ends in 1. Treating all four as variable means enumerating sixteen cases instead of the necessary sixteen over only the two that move — and, worse, invites you to imagine 5a5^a cycling, which it does not.

The question asks for a COUNT, or sometimes for a SUM of the distinct values

CDS sets both phrasings, and they sit next to each other in the same paper. "How many distinct remainders" wants 5; "the sum of all distinct remainders" wants the total of that set. Re-read the last line of the stem before you answer.

Summary — formulas & gotchas at a glance

A revision cheat-sheet for the formulas and gotchas above. Click any concept name to jump back to its full explanation.

Formulas (4)

  • Reducing the exponent modulo 4

    Exponent reduction

    bn ends in the r-th cycle entry,r=nmod4    (r=04th entry)b^{n} \text{ ends in the } r\text{-th cycle entry}, \quad r = n \bmod 4 \;\;(r=0 \Rightarrow \text{4th entry})
  • Unit digits of sums, differences and products of powers

    Unit digit of a combination

    (A±B)mod10=[(Amod10)±(Bmod10)]mod10(A \pm B) \bmod 10 = \big[(A \bmod 10) \pm (B \bmod 10)\big] \bmod 10
  • A number that is odd and a multiple of 5 must end in 5

    Odd multiple of five

    5N  and  N odd    N5(mod10)5 \mid N \;\text{and}\; N \text{ odd} \;\Longrightarrow\; N \equiv 5 \pmod{10}
  • Counting how many unit digits an expression can produce

    Number of cases to check

    cases=moving terms(period of that term)\text{cases} = \prod_{\text{moving terms}} (\text{period of that term})

Reference tables (1)

The unit-digit cycle of each base10 rows
Last digit of baseCycle of unit digitsPeriod
001
111
22, 4, 8, 64
33, 9, 7, 14
44, 62
551
Every positive power of a number ending in 5 ends in 5. There is no alternation.
661
77, 9, 3, 14
88, 4, 2, 64
99, 12
Read the cycle left to right starting at exponent 1. Every period divides 4, so exponent modulo 4 settles every case.

Watch out for (8)

Drill every past-year question on this subtopic

13 questions from the bank — paginated, with cart and Word-export support.

Related notes