Data Structures & AlgorithmsModerateTCS NQT · ICPC regional
Problem: The number 2^10 − 1 has how many distinct prime factors?
- A. 3
- B. 4
- C. 2
- 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
- Problem: A text buffer contains "hello world". Each space is replaced by the three characters "%20" (URL-style encoding). What is the…
- Problem: The bitwise AND of all integers from 12 to 15 inclusive is computed. What is the result?
- Problem: A row of 5 seats is filled by 3 distinct people, leaving 2 seats empty. How many arrangements are possible if the empty seats…
- Problem: The sum of the squares of the odd numbers from 1 to 19 is what value?
- Problem: A grid of 3 rows and 3 columns is filled with the numbers 1 to 9 row by row. A "line" is a complete row, column or main diagonal…
- Problem: What is the number of lattice points (x, y) with x, y ≥ 0 and x + y ≤ 5?