#include <iostream>
#include<bits/stdc++.h>
#include<unordered_map>
#define ll long long
using namespace std;
int main() {
std::ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL);
int t; cin >> t;
while (t--) {
ll n; cin >> n;
cout <<(ll) n*(n*n+1)/2 << "\n";
}
return 0;
}