//hdu2502
#include <iostream>
using namespace std;
int C(int n, int p)
{
double ret = 1;
while(p)
{
ret *= (double)n / p;
p--;
n--;
}
return (int)(ret + 0.5);
}
//binomial coefficient
void bi_co(int n, int* p)
{
for(int i = 1; i <= n + 1; i++)
p[i] = C(n, i - 1);
}
int main()
{
int t, n, sum, i;
int p[25] = {0};
cin >> t;
while (t--)
{
sum = 0;
cin >> n;
n--;
bi_co(n, p);
//n == p + q
//p 1s and q 0s,choose p positions for 1, the rest is 0's positions
for(i = 1; i <= n + 1; i++)
sum += i * p[i];
cout << sum << endl;
}
return 0;
}