Data Structures & AlgorithmsModerateTCS NQT · ICPC regional

Problem: The number 2^10 − 1 has how many distinct prime factors?

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

Correct answer: A. 3

1023 = 3 × 11 × 31, so there are three distinct prime factors. Counting prime factors with multiplicity gives the same count here, since none repeats.

More Coding Interview Problems questions

Exams that ask this topic