Data Structures & AlgorithmsModerateICPC regional · TCS NQT
Problem: What is the sum of the proper divisors of 220 (divisors less than 220)?
- A. 284
- B. 504
- C. 18
- D. 11
Correct answer: A. 284
Proper divisors 1, 2, 4, 5, 10, 11, 20, 22, 44, 55, 110 sum to 284 (220 and 284 are amicable). Including 220 gives 504, adding the prime factors 2 + 5 + 11 gives 18, and 11 counts the divisors.
More Coding Interview Problems questions
- Problem: What is the smallest positive integer n such that 1 + 2 + … + n is divisible by 10?
- Problem: Compute 7^100 mod 13.
- Problem: Using US coin denominations 1, 5, 10, 25, what is the minimum number of coins needed to make 63 (greedy works for these…
- Problem: Count the walks of length 3 on the path graph P4 (vertices 1–4, edges 1-2, 2-3, 3-4) that start and end at the same vertex. Walks…
- Problem: The array [2, 7, 4, 1, 8, 1] is examined by a sweep: for each index i, the value a[i] is compared with the minimum of the…
- Problem: Starting with the stack [1] (top is the rightmost element), the operations are: push 2, push 3, pop, push 4, push 5, pop, pop…