#include<bits/stdc++.h>
using namespace std;
#define rep(i,k,n) for(long long i=k;i<=n;i++)
#define per(i,n,k) for(long long i=n;i>=k;i--)
#define pb push_back
#define fi first
#define se second
///#pragma GCC optimize(3,"Ofast","inline")
typedef unsigned long long ull;
//#define ll __int128
typedef long long ll;
typedef double db;
typedef long double ldb;
typedef pair<ll,ll> pll;
inline ll gcd(ll a,ll b)
{
    while(b^=a^=b^=a%=b);
    return a;
}
inline void write(ll x)
{
    if(x<0)
        putchar('-'),x=-x;
    if(x>9)
        write(x/10);
    putchar(x%10+'0');
}
inline ll read()
{
    ll x=0;
    char f=1,c=getchar();
    while(c<'0'||c>'9')
    {
        if(c=='-')
            f=-1;
        c=getchar();
    }
    while(c>='0'&&c<='9')
    {
        x=x*10+c-'0';
        c=getchar();
    }
    return x*f;
}
inline ll fmul(ll a,ll b,ll mod)
{
    ll ans=0;
    a%=mod;
    while(b)
    {
        if(b&1LL)
            ans=(ans+a)%mod;
        a=(a+a)%mod;
        b>>=1LL;
    }
    return ans;
}
inline ll fp(ll a,ll b,ll mod)
{
    ll ans=1LL;
    a%=mod;
    while(b)
    {
        if(b&1LL)
            ans=ans*a%mod;
        a=a*a%mod;
        b>>=1LL;
    }
    return ans;
}
inline ll lcm(ll a,ll b)
{
    return a/gcd(a,b)*b;
}
const int N=1e5+1;
int main()
{
    ll _=read();
    rep(__,1,_)
    {
        ll n=read();
        ll LCM=1;
        ll cnt=1;
        ll ans=0;
        ll mod=1e9+7;
        while(1)
        {
            cnt++;
            ll now=n/LCM-n/lcm(LCM,cnt);
            //printf("lcm=%lld n/lcm=%lld  %lld  cnt=%lld\n",LCM,n/LCM,n/lcm(LCM,cnt),cnt);
            LCM=lcm(LCM,cnt);
            ans=(ans+now*cnt%mod)%mod;
            if(n/LCM==0)break;
        }
       // cout<<cnt<<" "<<LCM<<endl;
        write(ans);
        if(__!=_)printf("\n");
    }
    End:return 0;
}
