#include <bits/stdc++.h>
using namespace std;
const int P = 1e9+7;
uint64_t gcd(uint64_t a, uint64_t b) {
	return b?gcd(b,a%b):a;
}
uint64_t lcm(uint64_t a, uint64_t b) {
	return a/gcd(a,b)*b;
}
int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	int T;
	cin >> T;
	while (T--) {
		uint64_t n;
		cin >> n;
		int ans = n%P;
		for (uint64_t k = 1, w = 1; w<=n; w=lcm(w,++k)) {
			ans = (ans+n/w)%P;
		}
		cout << ans << '\n';
	}
}