/*************************************************************************
	> File Name: c.cpp
	> Author: whaleshark
	> Mail: whalesong0622@163.com 
	> Created Time: 三  7/28 15:30:37 2021
 ************************************************************************/

#include<bits/stdc++.h>
using namespace std;
#define LL long long
template<typename T>void Read(T &x){x=0;char ch=getchar();LL f=1;while(!isdigit(ch)){if(ch=='-')f*=-1;ch=getchar();}while(isdigit(ch)){x=x*10+ch-48;ch=getchar();}x*=f;}
template<typename T,typename... Args>void Read(T &x,Args&... args){Read(x);Read(args...);}
inline int64_t QuickPow(LL base,LL n,LL Mod=0){LL ret(1);while(n){if(n&1){ret*=base;if(Mod)ret%=Mod;}base*=base;if(Mod)base%=Mod;n>>=1;}return Mod?ret%Mod:ret;}
inline int64_t __inv(LL x,LL p){return QuickPow(x,p-2,p);}
#define REP(i, a, n) for (int i = a; i <= n; ++i)
#define PER(i, n, a) for (int i = n; i >= a; --i)
const int kMax = 1e5 + 10;
const int kMod = 1e9 + 7;
LL gcd(LL a,LL b){
	return b == 0?a:gcd(b,a%b);
}
LL lcm(LL a,LL b){
	return a/gcd(a,b)*b;
}
void test(int num){
	for(int i = 2;i <= num;i++){
		if(num%i != 0){
			cout<<num<<" "<<i<<'\n';
			return;
		}
	}
	cout<<num<<" "<<num+1<<'\n';
}
void solve(){
	LL n;
	cin>>n;
//	for(int i = 1;i <= n;i++)test(i);
	LL ans = 1,nxt = 1,res = 0;
	for(int i = 1;;i++){
		ans = lcm(ans,i);
		if(ans > n)break;
		nxt = lcm(ans,i+1);
		res = (res + (i+1)*(n/ans-n/nxt)%kMod)%kMod;
	}
	cout<<res<<'\n';
}
int main(){
    int T(1);
    Read(T);
    while(T--)solve();
    return 0;
}

