#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
int main(){
int t;
cin >> t;
while(t--){
int n;
cin >> n;
int i = 1;
long long sum = 0;
while( i <= n){
sum += (i-1)*n+i;
i++;
}
cout << sum << endl;
}
return 0;
}