#include <bits/stdc++.h>
#define lson root << 1
#define rson root << 1 | 1
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<ll> VI;
const int maxn = 2e5 + 2;
const int maxm = 2e5 + 5;
const int inf = 0x3f3f3f3f;
const ll mod = 1e9 + 7;
const double eps = 1e-4;
ll read()
{
    ll s = 0, w = 1;
    char c = getchar();
    for (; !isdigit(c); c = getchar())
    {
        if (c == '-')
            w = -1;
    }
    for (; isdigit(c); c = getchar())
    {
        s = (s << 3) + (s << 1) + (c ^ 48);
    }
    return (w == 1 ? s : -s);
}
int v[maxn], prime[maxn], m;
void primes()
{
    memset(v, 0, sizeof(v));
    for (int i = 2; i < maxn; i++)
    {
        if (v[i] == 0)
        {
            v[i] = i;
            prime[++m] = i;
        }
        for (int j = 1; j <= m; j++)
        {
            if (prime[j] > v[i] || prime[j] > maxn / i)
                break;
            v[i * prime[j]] = prime[j];
        }
    }
}
ll gcd(ll a, ll b)
{
    return b ? gcd(b, a % b) : a;
}
ll lcm(ll a, ll b)
{
    return a * b / gcd(a, b);
}
int main()
{
    int t = read();
    while (t--)
    {
        ll n = read(), mul = 1;
        ll ans = 0, now = n;
        for (ll i = 2;; i++)
        {
            mul = lcm(mul, i);
            ll newn = n / mul;
            ll add = (now - newn) * i % mod;
            ans = (ans + add) % mod;
            now = newn;
            if (newn == 0)
                break;
        }
        cout << ans << endl;
    }
    return 0;
}