#pragma GCC optimize("O3", "inline")
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
#define pb push_back
#define ub upper_bound
#define INF 1e18 + 100
const int maxn = 1e6;
int spf[maxn + 1];
int divsc[maxn + 1];
ll pa[maxn + 2];
void prec(){
fill(spf, spf + maxn, 0);
vector<int> primes;
spf[1] = 1;
for(int i = 2; i <= maxn; i++){
if(!spf[i]){
spf[i] = i;
primes.pb(i);
}
for(int p: primes){
if(i * p > maxn) break;
spf[i * p] = p;
if(i % p == 0) break;
}
}
divsc[1] = 1;
for(int i = 2; i <= maxn; i++){
ll me = 1;
int x = i;
while(x > 1){
int fac = spf[x];
int cnt = 0;
while(spf[x] == fac){
cnt++;
x /= fac;
}
me = me * (cnt + 1);
}
divsc[i] = me;
}
pa[1] = 0;
for(int i = 1; i <= maxn; i++){
pa[i + 1] = pa[i] + divsc[i] - 1;
}
}
ll solve()
{
int n;
cin >> n;
return pa[n + 1];
}
signed main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int t = 1;
cin >> t;
prec();
while(t--)
{
ll x = solve();
cout << x << "\n";
}
return 0;
}