#include <bits/stdc++.h>
using namespace std;
const long long MOD = 998244353, INF = 2E18 + 5;
const double PI = 2 * acos(0.0);
const long double EPS = 1.0E-14;
long long arrPow[35];
int main() {
  arrPow[0] = 1;
  for (int i = 1; i <= 30; i++) {
    arrPow[i] = arrPow[i - 1] * 2;
  }
  long long t;
  cin >> t;
  while (t--) {
    long long n, nibo, a = 0, b = 0;
    cin >> n;
    nibo = n / 2;
    for (int i = 1; i < nibo; i++) {
      a += arrPow[i];
    }
    a += arrPow[n];
    for (int i = nibo; i < n; i++) {
      b += arrPow[i];
    }
    cout << abs(a - b) << endl;
  }
  return 0;
}
