#include <bits/stdc++.h>
#define all(x) begin(x), end(x)
using namespace std;
using ll = long long;
const char nl = '\n', sp = ' ';
void solve() {
int n;
cin >> n;
int m = n;
ll ans = 0;
for (int l = 1, r; l <= m; l = r + 1) {
r = m / (m / l);
ans += 1ll * (r - l + 1) * (m / l);
}
ans -= n;
cout << ans << nl;
}
signed main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
#ifdef LOCAL
freopen("../in.txt", "r", stdin);
freopen("../out.txt", "w", stdout);
#endif
int t = 1;
cin >> t;
while (t--) {
solve();
}
}