Data Structures & AlgorithmsHardGATE CS

What are the last three digits of 7^2025?

  1. A. 649
  2. B. 807
  3. C. 401
  4. D. 007

Correct answer: B. 807

7^100 is congruent to 1 modulo 1000 (the order of 7 divides 100), so 7^2025 is congruent to 7^25, which is 807. Using the exponent 2024 or 2026 moves along the cycle by one step.

More Coding Interview Problems questions

Exams that ask this topic