Data Structures & AlgorithmsModerateGATE CS · ICPC regional

How many integers in [1, 200] are coprime to 210?

  1. A. 47
  2. B. 48
  3. C. 49
  4. D. 51

Correct answer: A. 47

210 = 2 * 3 * 5 * 7, so a number is coprime to 210 when it avoids all four primes; inclusion-exclusion over the four primes gives the count.

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

Exams that ask this topic