P14326 [GeeksforGeeks] Euler totient sum and divisors5501
普及-
题目描述

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
Your Task:
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 <= 10^{6}

输入格式

见题面

输出格式

见题面

样例输入
N = 5
样例输出
5