#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5 + 5;
long long log(long long n, long long x) {
  long long count = 0;
  while (n % x == 0) {
    n /= x;
    count++;
  }
  return count;
}
void dfs(long long depth[], vector<vector<long long> > tree, long long u,
         bool vis[]) {
  vis[u] = 1;
  for (auto it : tree[u]) {
    if (!vis[it]) {
      depth[it] = depth[u] + 1;
      dfs(depth, tree, it, vis);
    }
  }
  return;
}
long long powerm(long long x, long long y, long long p) {
  long long r = 1;
  while (y) {
    if (y & 1) r = (r * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return r % p;
}
long long modinv(long long x, long long m) { return powerm(x, m - 2, m); }
long long gcd(long long a, long long b) {
  if (a == 0) return b;
  if (b == 0) return a;
  if (a < b) swap(a, b);
  return gcd(b, a % b);
}
int32_t main() {
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    if (n == 2)
      cout << 2 << '\n';
    else {
      long long a = 0, b = 0;
      for (long long i = 1; i <= n / 2 - 1; i++) {
        a += pow(2, i);
      }
      a += pow(2, n);
      for (long long i = n / 2; i <= n - 1; i++) {
        b += pow(2, i);
      }
      cout << abs(a - b) << '\n';
    }
  }
  return 0;
}
