← All problemsSign in

Basic Theory of number

Number theory is the most important part of competitive programming. So Ritam wanted to test his newly acquired knowledge of the Euler's totient function. The totient phi(n) of all positive integer **n** greater than 1 is defined to be the number of positive integers less than **n** that are coprime to **n**. So the task is that, you will be given a number **n**, you need to print the value of

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start