#include <cstdio>
#include <algorithm>
#include <queue>
#include <cstring>
using namespace std;
const int maxn = 1e5 + 10;
const int p = 1e9 + 7;
typedef long long ll;

ll gcd(ll x, ll y)
{
    return x % y == 0 ? y : gcd(y, x % y);
}

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

int main()
{
    int _;
    scanf("%d", &_);
    while ( _-- ) {
        ll n;
        scanf("%lld", &n);
        ll temp = 1;
        ll ans = n % p;
        ll cnt = 1;
        while ( temp <= n ) {
            ans = (ans + n / temp) % p;
            temp = lcm(temp, ++cnt);
        }
        printf("%lld\n", ans % p);
    }
    return 0;
}