eolymp
bolt
Try our new interface for solving problems
Problems

Mertens function

Mertens function

The Mobius function μ(n) – a multiplicative function, so named after the famous nineteenth-century mathematician August Mobius, the well-known as his band. Function is defined in the following recurrence relation:

prb3239-1

The Mobius function is associated with the function of Mertens' equation:

prb3239-2

Find the value of Mertens function for a given number n.

Input

The first line contains the number of tests t (1t105). Each test consists of a single number n (1n107).

Output

For each test case print on a separate line the value of Mertens function.

Time limit 1 second
Memory limit 128 MiB
Input example #1
4
2
1
4
7
Output example #1
0
1
-1
-2
Author Evgeniy Sluzhaev