Data Structures & AlgorithmsHardGATE CS · ICPC regional

What is the sum of Euler's totient phi(i) for i = 1 to 10 (phi(i) counts the integers k in [1, i] with gcd(k, i) = 1)?

  1. A. 32
  2. B. 33
  3. C. {C+7}
  4. D. 35

Correct answer: A. 32

phi(1..10) are 1, 1, 2, 2, 4, 2, 6, 4, 6, 4 and sum to 32. Remember phi(1) = 1.

More Arrays, Strings, Linked Lists, Stacks, Queues and Hashing questions

Exams that ask this topic