Timer is Running

Euler Totient Sum and Divisors
Submissions: 7   Accuracy: 0%   Difficulty: Basic   Marks: 1

Given a number N find the sum of the Euler Totient values of all the divisors of N.

Example 1:

```Input:
N = 5
Output:
5
Explanation:
1 and 5 are the factor
of 5 and Φ(1) = 1 and
Φ(5) = 4 and their sum
is 4 + 1 = 5
```

Example 2:

```Input:
N = 1
Output:
1
Explanation:
1 is the only factor of
1 and Φ(1) = 1
```

You don't need to read input or print anything. Your task is to complete the function phiSum() which takes an integer N as input parameter and returns an integer, sum
of the Euler Totient values of all the divisors of N.

Expected Time Complexity: O(1)
Expected Space Complexity: O(1)

Constraints:
1 <= N <= 106

** For More Input/Output Examples Use 'Expected Output' option **

Author: Hemang Sarkar

If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.

Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.

to report an issue on this page.