#include <bits/stdc++.h>
using namespace std;
vector<int> vec{};
int numof(string sing, char x) {
  map<char, int> nuof;
  string a = sing;
  for (char c : a) {
    nuof[c]++;
  }
  return nuof[x];
}
bool isComposite(int n) {
  if (n <= 1) return false;
  if (n <= 3) return false;
  if (n % 2 == 0 || n % 3 == 0) return true;
  for (int i = 5; i * i <= n; i = i + 6)
    if (n % i == 0 || n % (i + 2) == 0) return true;
  return false;
}
int main() {
  int a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y,
      z, count;
  a = b = c = d = e = f = g = h = i = j = k = l = m = n = o = p = q = r = s =
      t = u = v = w = x = y = z = count = 0;
  cin >> t;
  while (t--) {
    cin >> n;
    p = n / 2;
    q = p - 1;
    cout << (pow(2, n) + 2 * (pow(2, q) - 1)) - pow(2, p) * (pow(2, p) - 1)
         << endl;
  }
}
