#include <bits/stdc++.h>
 
#define int long long int
#define pii pair<int,int>
#define vi vector<int>
#define vii vector<pii>
#define mii map<int,int>
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define MOD 1000000007
#define FOR(i,a,n) for(int i=a;i<n;i++)
#define FORD(i,a,n) for(int i=n-1;i>=0;i--)
#define MAX LLONG_MAX
#define MIN LLONG_MIN
 
using namespace std;

int gcd(int a,  int b)
{
  if (b == 0)
    return a;

  return gcd(b, a % b);
}
 

int lcm(int a, int b)
{
    int val = (a / gcd(a, b)) * b;
    return val;
}


int32_t main()
{
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    ios_base::sync_with_stdio(false);
    // cin.tie(NULL);

    int t;cin>>t;

    map<int,int> m;
    int pro = 1LL;
    int i =2;
    while(pro<=LLONG_MAX && pro>0){
        int j;
        for(j =i;;j++)
            if(pro%j!=0 || j>pro)
                break;
        m[pro]=j;
        pro =lcm(pro,j);
        i=j+1;

    }
    // for(auto it = m.begin();it!=m.end();it++)
    // {
    //     cout<<it->ff<<" ";
    // }

    while(t--)
    {
        int n;cin>>n;

        int counter =0;
        int ans =0;
        map<int,int>:: reverse_iterator it;
        for(it=m.rbegin();it!=m.rend();it++)
        {
            int val = it->ss;
            int div = it->ff;

            int x = n/div;
            ans+=(((x-counter)%MOD)*val)%MOD;
            ans%=MOD;
            counter =x;
        }
        cout<<ans<<endl;

}


    // while(t--)
    // {
    //     int n;cin>>n;
    // }    

}