#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 1000000;
int divisor_count[MAX_N + 1];
long long prefix_sum[MAX_N + 1];
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
// Initialize divisor counts to 0
memset(divisor_count, 0, sizeof(divisor_count));
// Sieve to count number of divisors for each number
for (int i = 1; i <= MAX_N; i++) {
for (int j = i; j <= MAX_N; j += i) {
divisor_count[j]++;
}
}
// Compute prefix sums of divisor counts
prefix_sum[0] = 0;
for (int i = 1; i <= MAX_N; i++) {
prefix_sum[i] = prefix_sum[i-1] + divisor_count[i];
}
int T; cin >> T;
while (T--) {
int N; cin >> N;
// answer = sum of divisors counts from 1..N - N
cout << prefix_sum[N] - N << "\n";
}
return 0;
}