#nt1003. 互质集合

互质集合

Coprime Subsets

Problem Description

There are TT queries. Each query gives a number nn; count how many non-empty subsets of {1,2,…,n}\{1, 2, \dots, n\} have greatest common divisor equal to 11. Output the answer modulo 109+710^9 + 7.

Input Format

The first line contains one integer TT.

Each of the next TT lines contains one integer nn.

Output Format

Output TT lines, each containing one number: the answer.

Sample Input

3
10
1000
1000000

Sample Output

983
912086516
822856275

Constraints

For all test cases, 1≤T≤10001 \le T \le 1000 and 1≤n≤1071 \le n \le 10^7.