#include<bits/stdc++.h>
using namespace std;
#define ll long long
const int mod = 1e9 + 7;
ll __gcd(ll a, ll b)
{
	return b ? __gcd(b, a%b) : a;
}
ll lcm(ll a, ll b) {
	return a / __gcd(a, b)*b;
}
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	int T;
	cin >> T;
	while (T--) {
		ll n;
		cin >> n;
		ll kase = 1;
		ll cnt = 1;
		ll ans = 0;
		for (ll i = 1; i <= n; i++) {
			kase = lcm(kase, i);
			cnt = lcm(kase, i + 1);
			if (kase > n)break;
			ans += (n / kase - n / cnt)*(i + 1) % mod;
			ans %= mod;
		}
		cout << ans << endl;
	}
	return 0;
}