// Author : Mc_LaReN

#include <bits/stdc++.h>
#define IOS ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
using namespace std;
const int MOD = 1e9 + 7, MX = 400005;

#define DEBUG       cerr<<"/n>>>I'm Here<<</n"<<endl;
#define what_is(x) cerr << #x << " is " << x << endl;
#define pf push_front
#define pb push_back
#define endl "\n"
#define ll int64_t
#define sz(x) (int)x.size()
#define max(x, y) (y-x >> 31 & (x^y) ^ y)
#define min(x, y) (y-x >> 31 & (x^y) ^ x)

template <class X> void swp( X &a, X &b) { X tp = a; a = b; b = tp; }
template <class X> void print(vector<X> &a) {for(auto& it : a) cout<<it<<" "; cout<<endl;}

ll gcd(ll x,ll y){
    return (y==0 ? x : gcd(y, x % y) );
}
ll LCM(ll x,ll y){
    return (x/gcd(x,y))*y;
}

char ch,ch1,ch2,ch3;
string s,s1,s2,s3;
vector<long long> v,v1,v2,v3;
vector<int> vi;
vector<string> vstr,vstr2,vstr3;

void run();

int32_t main()
{
    IOS;
    
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("error.txt", "w", stderr);
    freopen("output.txt", "w", stdout);
    #endif

    int t;
    cin >> t;
    while(t--)
    {
        run();
        cout << "\n";
    }      
    
    #ifndef ONLINE_JUDGE
    cerr<<"time taken : "<<(float)clock()/CLOCKS_PER_SEC<<" secs"<<endl;
    #endif
   
    return 0;
}


void run()
{
    ll n;
    cin>>n;
    ll a=1, ans = 0;
    for(ll i = 1; i <= n; ++i){
    //     ans+=n/a;
    //     // a=LCM(a,i);
        a=LCM(a,i);
        if(a>n)break;
        ans+=n/a;
    }
    cout<< (ans+n) % MOD;
}

