#include <iostream>
using namespace std;
int main() {
int t ;
cin>>t;
while(t--)
{
int n ;
cin>>n;
long long j =((n-1)*n)/2;
long long r = (n*(n+1))/2;
cout<<(j)*n +r<<endl;
}
}