#P1036F. Relatively Prime Powers
Relatively Prime Powers
No submission language available for this problem.
Description
Consider some positive integer . Its prime factorization will be of form
Let's call elegant if the greatest common divisor of the sequence is equal to . For example, numbers , , are elegant and numbers (), () are not.
Count the number of elegant integers from to .
Each testcase contains several values of , for each of them you are required to solve the problem separately.
The first line contains a single integer () — the number of values of in the testcase.
Each of the next lines contains a single integer ().
Print lines — the -th line should contain the number of elegant numbers from to .
Input
The first line contains a single integer () — the number of values of in the testcase.
Each of the next lines contains a single integer ().
Output
Print lines — the -th line should contain the number of elegant numbers from to .
Samples
Note
Here is the list of non-elegant numbers up to :
- ;
- ;
- .
The rest have .