#include <bits/stdc++.h>
using namespace std;
#define fast ios::sync_with_stdio(false); cin.tie(nullptr);
#define ll long long
#define endl '\n'
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
const int oo = 1e9;
const ll INF = 1e18;
const ll MOD = 1e9+7;
const int N = 1e6;
long long binpow(long long a, long long b, long long m) {
a %= m;
long long res = 1;
while (b > 0) {
if (b & 1)
res = res * a % m;
a = a * a % m;
b >>= 1;
}
return res;
}
void solve(){
int n ; cin >> n;
ll dp[n+1];
vector<int> freq(n+1), cnt(n+1);
for(int i = 1; i <= n; i++){
int x;
cin >> x;
freq[x]++;
}
for(int i = 1; i <= n; i++){
for(int j = i; j <= n; j += i){
cnt[i] = (cnt[i]%MOD + freq[j]%MOD)%MOD;
}
}
for(int i = n; i >= 1; i--){
dp[i] = (binpow(2, cnt[i], MOD) - 1 + MOD) % MOD;
for(int j = 2*i; j <= n; j += i){
dp[i] = (dp[i] - dp[j] + MOD) % MOD;
}
}
for(int i = 1; i <= n; i++){
cout << dp[i] << '\n';
}
}
int main(){
fast
int t = 1; //cin >> t;
while(t--) solve();
}
/*
* at least and exact
* 1 2 3 4 5 6 7 8 9 10
* gcd = 10 -> 2^(10/10)-1 = 1 -> {10}
* gcd = 9 -> 2^(10/9)-1 = 1 -> {9}
* gcd = 8 -> 2^(10/8)-1 = 1 -> {8}
* gcd = 7 -> 2^(10/7)-1 = 1 -> {7}
* gcd = 6 -> 2^(10/6)-1 = 1 -> {6}
* gcd = 5 -> 2^(10/5)-1 - gcd(10) = 3-1 = 2 -> {5} {5 10}
* gcd = 4 -> 2^(10/4)-1 - gcd(8) = 3-1 = 2 -> {4} {4 8}
* gcd = 3 -> 2^(10/3)-1 - gcd(6) - gcd(9) = 7-1-1 = 5 -> {3} {3 6} {3 9} {6 9} {3 6 9}
* gcd = 2 -> 2^(10/2)-1 - gcd(4) - gcd(6)-gcd(8) - gcd(10) = 31-2-1-1-1 = 26
*/