#include using namespace std; int logfloor(int a, long long b){ //floor(log_a(b)) if (a > b){ return 0; } else { int res = 1; long long A = a; while (A * a <= b){ A *= a; res++; } return res; } } int main(){ int T; cin >> T; for (int i = 0; i < T; i++){ long long N; cin >> N; long long ans = N * N * 2 - N; for (int j = 2; j * j <= N; j++){ //j: base int X = logfloor(j, N); for (int k = 1; k <= X; k++){ for (int l = 1; l <= X; l++){ if (k != l){ ans += N / max(k, l); } } } } cout << ans << endl; } }