#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b, int &x, int &y) {
  if (a == 0) {
    x = 0;
    y = 1;
    return b;
  }
  int x1, y1;
  int g = gcd(b % a, a, x1, y1);
  x = y1 - (b / a) * x1;
  y = x1;
  return g;
}
bool diofant_any(int a, int b, int c, int &x, int &y, int &g) {
  g = gcd(abs(a), abs(b), x, y);
  if (c % g != 0) return false;
  x *= c / g;
  y *= c / g;
  if (a < 0) x *= -1;
  if (b < 0) y *= -1;
  return true;
}
int y;
bool cmp(pair<int, int> a) { return a.second == y; }
int main() {
  int T;
  int n;
  cin >> T;
  for (int tt = 0; tt < T; ++tt) {
    cin >> n;
    int c1 = 0, c2 = 0;
    for (int i = 1; i < n / 2; i++) {
      c1 += pow(2, i);
    }
    for (int i = n / 2; i < n; i++) {
      c2 += pow(2, i);
    }
    cout << abs(c1 - c2 + pow(2, n)) << '\n';
  }
  return 0;
}
