The** Euler Totient **Function for a positive integer N is defined as the number of positive integers less than or equal to N and relatively prime to N.

For example, an algorithm to find **Euler Totient** Function value of N will be:

*int phi(unsigned int N)
{
unsigned int result = 1;
for (int i=2; i < N; i++)
if (gcd(i, N) == 1)
result++;
return result;
}*

The task is to find the **sum** of the **Euler Totient** Values of all the divisors of the given number.

**Input: **

The first line of input contains a single integer **T** denoting the number of test cases. Then **T** test cases follow. Each test case consists of a single line containing a positive integer **N**.

**Output:**

Corresponding to each test case, in a new line, print the sum of the Euler Totient Function values of all the divisors of the given number.

**Constraints:**

1 ≤ T ≤ 10000

1 ≤ N ≤ 10^{6}

**Example:**

**Input:**

2

1

2

**Output:**

1

2

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.

akhyasharma01 | 467 |

ASWATHAMA | 399 |

john_wick | 360 |

mmzeineddine | 295 |

PiyushPandey4 | 271 |

PiyushPandey4 | 614 |

ASWATHAMA | 561 |

akhyasharma01 | 547 |

john_wick | 521 |

rahulnishad96 | 442 |

blackshadows | 5362 |

Ibrahim Nash | 5242 |

akhayrutdinov | 5111 |

mb1973 | 4929 |

Quandray | 4598 |

Login to report an issue on this page.