//string substr(start,length)
//string s(30,'+')
//fill(adj+1,adj+n+1,vector<int>())
#include <bits/stdc++.h>
using namespace std;
#define ccnt(s,c) (count((s).begin(),(s).end(),(c)))
#define upper(v,x) upper_bound(v.begin(), v.end(), x) - v.begin()
#define lower(v,x) lower_bound(v.begin(), v.end(), x) - v.begin()
#define ffind(a,x) find(a.begin(), a.end(), x) - a.begin()
#define rrotate(a,p) rotate(a.begin(), a.begin() + p, a.begin() + p + 1)
#define int long long
typedef long long LL;
typedef unsigned long long ULL;
typedef pair<int, int> PII;
const int N = 1e5+10, M = 30;
const int MOD=1e9+7;

inline int read(){
    int x=0,f=1;
    char ch=getchar();
    while(ch<'0'||ch>'9'){
        if(ch=='-')
            f=-1;
        ch=getchar();
    }
    while(ch>='0'&&ch<='9'){
        x=(x<<1)+(x<<3)+(ch^48);
        ch=getchar();
    }
    return x*f;
}
int gcd(int a, int b)
{
    return b ? gcd(b, a % b) : a;
}

int lcm(int x,int y){
	return x/gcd(x,y)*y;
}

void solve(){
    LL n;
    cin>>n;
    int G=1,ans=0;
    for(int i=1;G<=n;i++){
        G=lcm(G,i);
        if(G>n)break;
        ans+=n/G;
    }
    printf("%lld\n",(ans+n)%MOD);
}
signed main()
{
    int t=read();
    while(t--){
        solve();
    }
}