#include <bits/stdc++.h> // All praise is due to Allah alone, and peace and blessings be
using namespace std; // upon him, after whom there is no other Prophet.
int32_t main() {
cin.tie(0)->sync_with_stdio(false);
const int N = 1e6 + 1;
vector<int64_t> spf(N);
for(int i = 1; i <= N / 2; i++) {
for(int j = i + i; j < N; j += i) {
spf[j]++;
}
}
partial_sum(spf.begin(), spf.end(), spf.begin());
function<void()> Test_Case = [&]() {
int n; cin >> n;
cout << spf[n] << '\n';
};
int32_t Case = 1; cin >> Case;
for (int T = 1; T <= Case; T++) {
Test_Case();
}
return 0;
}