#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <climits>
#include <stdlib.h>
//stl
#include <deque>
#include <queue>
#include <stack>
#include <algorithm>
#include <list>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>
#include <string>
#include <vector>
#include <bitset>
//unused
#include <complex>
#include <functional>
#include <fstream>
#include <ctime>
#include <stdexcept>
#pragma warning(disable:4996)
using namespace std;
using namespace std;
typedef long long ll;
const ll mod = 1e9 + 7;
ll T, n, ans;
ll gcd(ll a, ll b){
	if (b == 0)
		return a;
	return gcd(b, a % b);
}
int main()
{
	scanf("%lld", &T);
	while (T--){
		ll lcm = 2;
		scanf("%lld", &n);
		ans = 2 * n % mod;
		for (ll i = 3; lcm <= n; i++){
			ans = (ans + n / lcm) % mod;
			lcm = lcm * i / gcd(lcm, i);
		}
		printf("%lld\n", ans);
	}
	return 0;
}