Data Structures & AlgorithmsHardICPC regional · number theory

Problem: What is the sum of all divisors of 360 = 2^3 * 3^2 * 5?

  1. A. 1080
  2. B. 1404
  3. C. 1170
  4. D. 1000

Correct answer: C. 1170

Multiplicativity gives sigma(360) = (2^4 - 1)/(2 - 1) * (3^3 - 1)/(3 - 1) * (5^2 - 1)/(5 - 1) = 15 * 13 * 6 = 1170. Using 2^3 instead of 2^4 - 1 is a classic slip.

More Coding Interview Problems questions

Exams that ask this topic