Mystique Function

Today we have a special function called Mystique Function.Mystique function for any value x is denoted by H(x). H(x) is defined as the count of positive integers such that (Let k be one of such positive integer)
1) x%k=0
2) for every integer z it satisfies (z^k-z)%k=0.
3) k>1
Now given a value x you need to print the sum of H(2)+H(3)+H(4)..H(x).
Input:
The first line contains T indicating the number of test cases.
Then T tines follow each containing a single integer x.
Output:
For each test case output the sum of H(2)+H(3)+H(4)..H(x).
Constraints:
1<=T<=10^4
2<=x<=10^6
Sample Input(Plaintext Link)
3
2
3
5
Sample Output(Plaintext Link)
1
2
4

Showing Answers 1 - 3 of 3 Answers

Rajesh Swarnkar

  • May 8th, 2016
 

The condition 2 is not very clear.
"for every integer z it satisfies (z^k-z)%k=0"
How would I test the satisfiability against every integer z as they are infinite?

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions