#include<bits/stdc++.h>
#define int long long
using namespace std;
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;
}
const int mod=1e9+7;
inline int gcd(int x,int y)
{
	if(!y) return x;
	return gcd(y,x%y);
}
inline int lcm(int x,int y){return x/gcd(x,y)*y;}
signed main()
{
	int t=read();	
	while(t--)
	{
		int n=read();
		int ans=n,llcm=1;
		for(int i=1;i<=n;i++)
		{
			llcm=lcm(i,llcm);
			ans=(ans+n/llcm)%mod;
			if(llcm>n) break;
		}
		printf("%lld\n",ans);
	}
}