Kalu has an integer number $$$N$$$. He defines the beauty of a number $$$k$$$ as follows:
If $$$k$$$ and $$$N$$$ are co-prime, the beauty of $$$k$$$ is $$$GCD(k−1,N)$$$. Otherwise, the beauty is $$$0$$$.
Kalu wants to find the sum of beauty for all integers $$$k$$$, such that $$$1 \le k \le N$$$.
However, Kalu is busy, so he asked you to write a program to help him with his task.
Notes
The first line of input contains an integer $$$T$$$ $$$(1 \le T \le 10^5)$$$, the number of test cases. Each of the next $$$T$$$ lines contains a single integer $$$N$$$ $$$(1 \le N \le 10^5)$$$.
For each test case, output a single integer, the sum of the beauty of all positive integers less than or equal to $$$N$$$.
15
8
For $$$N=5$$$, we need to find the sum of beauty for all integers $$$K$$$, such that $$$1 \le K \le N$$$. Let's start by finding the beauty of each number $$$K$$$.
Thus, the sum of beauty for all integers $$$K$$$, such that $$$1 \le K \le 5$$$ is $$$5 + 1 + 1 + 1 + 0 = 8$$$. Therefore, the answer for $$$N=5$$$ is $$$8$$$.
| Name |
|---|


