// #pragma GCC target ("avx2")
// #pragma GCC optimization ("O3")
// #pragma GCC optimization ("unroll-loops")
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,fma")
#include <bits/stdc++.h>
#include <iostream>
using namespace std;
#define fastio                        \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL)

#define f(i, a, b) for (ll i = a; i <= b; i++)
#define fr(i, a, b) for (ll i = a; i >= b; i--)
#define pb push_back
#define sz(a) ll(a.size())
#define mp make_pair
#define vi vector<ll>
#define vvi vector<vi>
#define pii pair<ll, ll>
#define all(p) p.begin(), p.end()
#define pvec(v, a, b)                   \
    {                                   \
        f(i, a, b) cout << v[i] << " "; \
        nl;                             \
    }
#define nl cout << "\n"
#define mii map<ll, ll>
#define deb(x) cout << #x << "=" << x << "\n"
#define deb2(x, y) cout << #x << "=" << x << "," << #y << "=" << y << endl
#define gout(x) cout << "Case #" << x << ": "
typedef long long ll;
const double EPS = 1e-9;
const ll MAX = 2e5 + 7;
const ll INF = 1e18;
const ll mod = 1e9 + 7;
ll x, y;
ll gcdExtended(ll a, ll b, ll *x, ll *y)
{

    if (a == 0)
    {
        *x = 0, *y = 1;
        return b;
    }

    ll x1, y1;
    ll gcd = gcdExtended(b % a, a, &x1, &y1);
    *x = y1 - (b / a) * x1;
    *y = x1;
    return gcd;
}

ll lcm(ll a, ll b)
{
    ll g = gcdExtended(a,b,&x,&y);
    return (a*b)/g;
}

void solve()
{
    ll n;
    cin >> n;
    ll c = 2;
    ll div = 1;
    ll ans = 0;
    while (div <= n)
    {
        ll l  = lcm(div, c);
        ll add = n / div;
        add -= n / l;
        add %= mod;
        ans += c * add;
        ans %= mod;
        div = l;
        c++;
    }
    cout << ans;
    nl;
}

int main()
{
    // auto start = chrono::high_resolution_clock::now();
    fastio;
    ll tc;
    tc = 1;
    cin >> tc;
    f(i, 1, tc)
        solve();
    //      auto end = chrono::high_resolution_clock::now();
    // //  Calculating total time taken by the program.
    // double time_taken =
    //     chrono::duration_cast<chrono::nanoseconds>(end - start).count();

    // time_taken *= 1e-9;

    // cout << "Time taken by program is : " << fixed
    //      << time_taken << setprecision(9);
    // cout << " sec" << endl;
    // return 0;
}
