/**
* In the name of Allah
* We are nothing and you're everything
* Ya Muhammad!
**/
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = uint64_t;
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
#define int long long
const char nl = '\n';
const int N = 1e5+5;
const ll inf = 0x3f3f3f3f3f3f3f3fll;
long long sum_n_div_i(int n) {
long long total = 0;
int i = 1;
while (i <= n) {
int v = n / i;
int next_i = n / v + 1;
int count = next_i - i;
total += 1LL * v * count;
i = next_i;
}
return total;
}
void solve() {
int n; cin >> n;
int res = sum_n_div_i(n);
cout << res-n << nl;
}
int32_t main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
int t; cin >> t;
while(t--)solve();
return 0;
}