
#include <iostream>
#define ll long long

ll n, x;
constexpr ll MOD = 1e9 + 7;


ll GCD(ll a, ll b) {
    if (b == 0)
        return a;
    return GCD(b, a % b);
}

ll LCM(ll a, ll b) {
    return a * b / GCD(a, b);
}

int main()
{
    std::cin >> n;
    for (int i = 0; i < n; i++) {
        std::cin >> x;
        ll val = 1;
        ll num = 2;
        ll count = 0;
        while (val <= x) {
            ll next = LCM(val, num);
            count += num * (x / val - x / next);
            count %= MOD;
            num++;
            val = next;
        }
        std::cout << count << '\n';
    }
}