Data Structures & AlgorithmsHardGATE CS · ICPC regional
What is Euler's totient phi(360), the number of integers in [1, 360] coprime to 360?
- A. 96
- B. 97
- C. 98
- D. 100
Correct answer: A. 96
360 = 2^3 * 3^2 * 5, so phi = 360 * (1 - 1/2) * (1 - 1/3) * (1 - 1/5) = 96.
Practise more Arrays, Strings, Linked Lists, Stacks, Queues and Hashing questionsArrays, Strings, Linked Lists, Stacks, Queues and Hashing: notes and key points
More Arrays, Strings, Linked Lists, Stacks, Queues and Hashing questions
- How many unordered pairs of distinct integers {a, b} from 1 to 12 are coprime to each other?
- What is the sum of i^3 mod 7 over i = 1 to 20?
- How many 1 bits does the binary representation of 45 contain?
- A robot on a circle of 8 positions (0 to 7) starts at 0 and jumps 3 positions forward each step, wrapping around. After how many steps…
- Trains arrive at times [900, 940, 950, 1100] and depart at times [910, 1200, 1120, 1130]. What is the minimum number of platforms needed…
- What is the most efficient general technique for the platform problem above (minimum platforms needed given arrival and departure times)?