#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <set>

using namespace std;

#define rep(i, a, b) for(int i = a; i < b; i++)

typedef long long ll;
typedef long double ld;

int Tests = 1;

const int MOD = 1e9 + 7;

ll gcd (ll a, ll b) {
    return b ? gcd (b, a % b) : a;
}

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    cin >> Tests;

    vector<int> good;





    while(Tests--)
    {
        ll n;
        cin >> n;

        ll ans = 0;

        ll NOK = 1;

        rep(i, 2, 48)
        {
            ll I = i;
            ll T = NOK;
            ll X = gcd(T, I);
            T /= X;
            I /= X;
            //cout << NOK << " " << I << " " << T << endl;
            ll N = n;
            N /= X;
            //cout << N / T - (N / T) / I << endl;
            ans += i * (N / T);
            ans -= i * ((N / T) / I);



            ans %= MOD;
            NOK = NOK * i / gcd(NOK, i);
            if(NOK > 1e16) break;
        }
        cout << ans << endl;
    }

    return 0;
}
