#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
#define sz(x) (ll)x.size()
#define m1(x) memset(x, 1, sizeof(x))
#define m0(x) memset(x, 0, sizeof(x))
#define inf(x) memset(x, 0x3f, sizeof(x))
#define flout(x) cout << fixed << setprecision(x)
#define pb(x) push_back(x)
#define MOD 1000000007
#define MAX 100000000000000000
#define mN 200001
ll cgcd(ll a, ll b){ return b == 0 ? a : cgcd(b,a%b); }
ll clcm(ll a, ll b) { return a/cgcd(a,b)*b; }
void solve() {
    ll n;
    cin >> n;
    // cout << n << endl;
    ll ans = (n/2*5) + (n%2)*2;
    ans %= MOD;
    // cout << ans << endl;
    ll x = 6;
    ll val = 3;
    while (x <= n) {
        if (x%val == 0) {
            ll inc = 0;
            while (x%val == 0) {
                val ++;
                inc ++;
                // cout << val << endl;
            }
            ans += (n/x)*inc;
            ans %= MOD;
            // cout << x << " " << val << endl;
            x = clcm(val, x);
        }
        // cout << x << endl;
    }
    cout << ans << endl;
}
int main() {
    ios_base::sync_with_stdio(0); cin.tie(0);
    int t;
    cin >> t;
    // t = 1;
    while (t--) {
        solve();
    }
}