Placement Prep

Last Two Digits of Large Numbers: Cycle Method and CRT

Find last two digits of any large power in 20 seconds. Covers the cycle method, CRT shortcut, and 4 verified examples. For TCS NQT and AMCAT prep.

By FACE Prep Team 7 min read
last-two-digits modular-arithmetic aptitude-tricks quantitative-aptitude placement-prep number-theory mental-math

The last two digits of N^M are exactly N^M mod 100, and the cycle method turns most placement-test problems on this topic into a 20-second lookup.

This is true whether the exponent is 87 or 2024 or 103. The arithmetic never touches the full number. It works on the cycle alone.

Why Last Two Digits Equal N^M mod 100

Place value explains this in one sentence: any integer N can be written as 100q + r, where r is the remainder when dividing by 100. Raising N to a power M and stripping everything above the hundreds place gives exactly N^M mod 100.

That is the entire foundation. The practical challenge is computing N^M mod 100 without actually computing N^M, which for exponents like 2024 would produce a number with hundreds of digits.

The solution is the cycle of remainders. For any fixed base N, the sequence N^1 mod 100, N^2 mod 100, N^3 mod 100, … eventually repeats. Once you know where it repeats (the period), you reduce the exponent to a small equivalent and read off the answer.

For odd bases that share no factor with 100 (i.e., not divisible by 2 or 5), the period always divides 40. In practice, the periods that appear in aptitude tests are 4, 5, 10, or 20.

The Cycle Method: Four Steps

Apply these steps to any last-two-digits problem.

  • Step 1 — Find the cycle. Compute N^1 mod 100, N^2 mod 100, and so on until you reach 01. Record every value; those values form the cycle.
  • Step 2 — Note the period P. P is the position at which 01 first appears in the cycle.
  • Step 3 — Reduce the exponent. Compute M mod P. Call the result R. If R = 0, set R = P (the period itself maps to 01).
  • Step 4 — Read the answer. The answer is the value at position R in the cycle.

Period-finding shortcut: For an unfamiliar base, try N^4 mod 100 first. If it equals 01, the period is 4. If not, try N^10 mod 100. If 01, period divides 10. Otherwise compute N^20 mod 100; for all odd bases coprime to 100, this is guaranteed to give 01.

The method also applies to calendar problems in aptitude tests and clock problems for competitive exams, where the “cycle” is 7 days or 12 hours instead of a digit pattern. The underlying skill is the same: find the period, reduce the exponent, look up the result.

Four Worked Examples

Example 1: Last Two Digits of 7^87

  • Step 1 — Build the cycle: 7^1 = 07, 7^2 = 49, 7^3 = 343 last two = 43, 7^4 = 2401 last two = 01. Cycle: (07, 49, 43, 01).
  • Step 2 — Period: 4 (01 appears at position 4).
  • Step 3 — Reduce exponent: 87 mod 4 = 3 (since 87 = 4 x 21 + 3).
  • Step 4 — Read position 3 in the cycle: 43.
  • Verification: pow(7, 87, 100) = 43. ✓

Example 2: Last Two Digits of 29^103

  • Step 1 — Build the cycle (mod 100): 29^1 = 29, 29^2 = 41, 29^3 = 89, 29^4 = 81, 29^5 = 49, 29^6 = 21, 29^7 = 09, 29^8 = 61, 29^9 = 69, 29^10 = 01. Cycle has 10 entries.
  • Step 2 — Period: 10.
  • Step 3 — Reduce exponent: 103 mod 10 = 3.
  • Step 4 — Read position 3 in the cycle: 89.
  • Verification: pow(29, 103, 100) = 89. ✓

Correction note: Some reference material states that 29^4 ≡ 01 (mod 100) and uses period 4 for this base. That is incorrect. 29^4 mod 100 = 81, not 01. The correct period is 10. The final answer of 89 is coincidentally the same under both methods because 103 mod 4 = 103 mod 10 = 3, but the intermediate claim about 29^4 is arithmetically wrong.

Example 3: Last Two Digits of 13^2024

  • Step 1 — Find the period. Using repeated squaring: 13^2 mod 100 = 69, 13^4 mod 100 = 61, 13^10 mod 100 = 49, 13^20 mod 100 = 01. Period: 20.
  • Step 2 — Reduce exponent: 2024 mod 20 = 4 (since 2024 = 20 x 101 + 4).
  • Step 3 — Read position 4 in the cycle: 61.
  • Verification: pow(13, 2024, 100) = 61. ✓

Correction note: Some reference material states the answer is 01, based on an incorrect claim that 13^4 ≡ 01 (mod 25). The correct value is 13^4 mod 25 = 11. The CRT calculation with x ≡ 01 (mod 4) and x ≡ 11 (mod 25) resolves to 61, not 01. The answer 01 is arithmetically wrong for this problem.

Example 4: Last Two Digits of 3^2026

  • Step 1 — Find the period. 3^20 mod 100 = 01. Period: 20. (Base 3 has units-digit period 4 but last-two-digit period 20 — see the trap section below.)
  • Step 2 — Reduce exponent: 2026 mod 20 = 6 (since 2026 = 20 x 101 + 6).
  • Step 3 — Compute 3^6 mod 100: 3^4 = 81, 3^6 = 81 x 9 = 729, last two = 29.
  • Verification: pow(3, 2026, 100) = 29. ✓

These four examples cover bases with periods 4, 10, 20, and 20. The method is identical in each case. Just like multiplying a number by 111 has a recognisable shortcut, every last-two-digits base has a cycle you can precompute in about 90 seconds.

The Chinese Remainder Theorem Route

When the cycle is not obvious or the base is large, the Chinese Remainder Theorem gives a structured alternative. Since 100 = 4 x 25 and gcd(4, 25) = 1, any residue mod 100 is uniquely determined by its residues mod 4 and mod 25 separately.

The procedure, shown here for 13^2024:

  • Mod 4: 13 ≡ 01 (mod 4), so 13^2024 ≡ 01 (mod 4).
  • Mod 25: The order of 13 mod 25 divides φ(25) = 20. 2024 mod 20 = 4. Compute 13^4 mod 25: 13^2 mod 25 = 169 mod 25 = 19, then 19^2 mod 25 = 361 mod 25 = 11. So 13^2024 ≡ 11 (mod 25).
  • CRT step: Solve x ≡ 01 (mod 4) and x ≡ 11 (mod 25). Write x = 25k + 11. Require 25k + 11 ≡ 01 (mod 4). Since 25 ≡ 01 (mod 4), we get k ≡ -10 ≡ 02 (mod 4). So k = 4j + 2, giving x = 100j + 61. Answer: 61.

This confirms the cycle-method answer.

The CRT route is worth knowing for two reasons. First, it handles cases where the base is not coprime to 100 (e.g., bases divisible by 2 but not 4, where the cycle method needs adjustment). Second, the mod-25 step uses the fact that φ(25) = 20, which is why the period of any base coprime to 100 always divides 20. That is not a coincidence; it is Euler’s theorem applied to the mod-25 component.

For TCS NQT and AMCAT numerical ability sections, the cycle method is faster in a test environment. The CRT is the backup when you encounter an unfamiliar base and cannot spot the period quickly.

A Common Trap: Unit-Digit Period vs Last-Two-Digit Period

The unit digit of N^n (i.e., N^n mod 10) cycles with a period that divides 4 for any base ending in 1, 3, 7, or 9. This is a standard aptitude fact most students memorise: units digits of powers of 3 follow the pattern 3, 9, 7, 1, 3, 9, 7, 1, … with period 4.

The mistake is applying that period-4 shortcut to last-two-digit problems.

It works for base 7 because the last-two-digit period of 7 also happens to be 4. That is the exception, not the rule.

For base 3, the units digit has period 4 and the last two digits have period 20. For base 9, units-digit period is 2 and last-two-digit period is 10. For base 29, units-digit period is 2 (the pattern 9, 1 repeats) and last-two-digit period is 10. Applying period 4 or period 2 to a last-two-digits problem with base 29 gives the right exponent reduction only by coincidence when the two periods share a common factor with the exponent.

The safe habit: always compute the cycle mod 100, not mod 10. It takes about 60 seconds longer but produces the correct period without guessing.

A table of periods for common aptitude-test bases:

BaseUnits-digit period (mod 10)Last-two-digit period (mod 100)
3420
744
9210
11110
13420
17420
19210
2115
29210
4344
4912

The takeaway: only bases 7 and 43 among the common single- and double-digit bases share the period-4 property for both units and last-two-digit cycles. Every other base requires a separate mod-100 computation.

The 29^103 worked example above demonstrates the cost of getting this wrong in the other direction: the period-4 assumption happens to give the same answer as the correct period-10 calculation for that specific exponent, but it will fail on exponents where 103 mod 4 and 103 mod 10 diverge.

Spotting modular arithmetic patterns and verifying them in code is a separate skill from solving them on paper. TinkerLLM gives FACE Prep students a workspace to write Python that builds these cycles for any base, run edge-case checks, and ask an LLM to explain why base 7 has period 4 while base 29 has period 10. That kind of hands-on exploration deepens the aptitude understanding faster than drilling problems alone. Worth starting at ₹299 before the placement window opens.

Primary sources

Frequently asked questions

What is the fastest way to find the last two digits of a large power?

Build the cycle of N^n mod 100 by computing successive powers until you reach 01. Note the period P. Then compute the exponent mod P and read off the corresponding value. Most aptitude test bases have periods of 4, 10, or 20.

How do I find the period of the last two digits cycle for any base?

Compute N^2, N^4, N^8 (repeated squaring) mod 100 until you land on 01. For odd bases not divisible by 5, the period always divides 20. Most bases in aptitude tests have period 4, 5, 10, or 20.

Is the last-two-digit period always the same as the units-digit period?

No. Base 7 is a rare case where both periods are 4. For most bases, the last-two-digit period is longer. Base 3 has a units-digit period of 4 (digits 3, 9, 7, 1 repeating) but its last-two-digit period is 20. Always compute mod 100 directly, not mod 10.

When should I use CRT to find the last two digits?

Use CRT when the base is large or unfamiliar and you cannot quickly determine the mod-100 cycle. Split into mod 4 (trivial for odd bases) and mod 25 (order divides 20 for bases coprime to 25), then combine. The CRT worked example for 13^2024 in this article shows the full procedure.

Which placement tests include last-two-digits problems?

TCS NQT Numerical Ability and AMCAT Quantitative Ability both include number theory problems where last-digits questions appear. These are typically 1-mark problems solvable in under 45 seconds with the cycle method.

Build AI projects

A self-paced playground for building with LLMs.

TinkerLLM is FACE Prep's sister property. A guided environment for shipping real LLM applications, the kind of project that earns a paragraph on your resume, not a line.

Try TinkerLLM (₹299 launch)
Free AI Roadmap PDF