/*
JAI JAGANNATH!
*/
//@Author : zanj0
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
template <class T>
using ordered_set = __gnu_pbds::tree<T, __gnu_pbds::null_type, less<T>, __gnu_pbds::rb_tree_tag, __gnu_pbds::tree_order_statistics_node_update>;
#define ff first
#define ss second
#define pb push_back
#define MOD 1000000007
#define inf 1e18
#define ps(x, y) fixed << setprecision(y) << x
#define w(x) \
int x; \
cin >> x; \
while (x--)
#define endl "\n"
#define timetaken cerr << "Time : " << 1000 * (long double)clock() / (long double)CLOCKS_PER_SEC << "ms\n"
typedef long long int lli;
void zanj0()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
#ifdef LOCAL
freopen("input.txt", "r", stdin);
#endif
}
const lli N = 1e6 + 5;
lli cnt[N];
void Pre()
{
lli i, j;
for (i = 1; i < N; i++)
{
for (j = i; j < N; j += i)
{
cnt[j]++;
}
}
for (i = 1; i < N; i++)
cnt[i] += cnt[i - 1];
}
lli HarmonicSum(lli x){
lli ret = 0;
lli i;
for(i = 1; i * i <= x; i++){
ret += x / i;
}
ret *= 2;
i--;
ret -= i * i;
ret -= x;
return ret;
}
void Solve()
{
lli n;
cin >> n;
cout << HarmonicSum(n) << endl;
}
int32_t main()
{
zanj0();
Pre();
w(t) Solve();
timetaken;
return 0;
}
/*
Number of pairs (i, j) such that j - i = gcd(i, j)
Let's say gcd(i, j) is g then (j % g) - (i % g) == 0
i = k * g
j = (k + 1) * g
k and (k + 1) will be co-prime
That means for g the pairs will be N / g - 1
*/