Data Structures & AlgorithmsHardICPC regional · Codeforces Div2 B

Problem: What is the remainder when 2^100 is divided by 9?

  1. A. 4
  2. B. 7
  3. C. 2
  4. D. 1

Correct answer: B. 7

2⁶ ≡ 1 (mod 9) and 100 ≡ 4 (mod 6), so 2¹⁰⁰ ≡ 2⁴ = 16 ≡ 7. 4 is just the reduced exponent, reducing the exponent mod 9 gives 2¹ = 2, and 1 assumes 6 divides 100.

More Coding Interview Problems questions

Exams that ask this topic