#include <bits/stdc++.h> using namespace std; #define pb push_back typedef long long ll; int main(){ ll T,n; cin>>T; while(T--){ cin>>n; cout<<((n*(n-1))/2)*(n+1)+n<<"\n"; } }