#include <bits/stdc++.h>
using namespace std;
struct custom_hash {
  static uint64_t splitmix64(uint64_t x) {
    x += 0x9e3779b97f4a7c15;
    x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
    x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
    return x ^ (x >> 31);
  }
  size_t operator()(uint64_t x) const {
    static const uint64_t FIXED_RANDOM =
        chrono::steady_clock::now().time_since_epoch().count();
    return splitmix64(x + FIXED_RANDOM);
  }
};
long long gcd(long long x, long long y) {
  if (x < y) return gcd(y, x);
  if (y == 0) return x;
  return gcd(y, x % y);
}
long long mystoi(string str) {
  stringstream ss(str);
  long long ans = 0;
  ss >> ans;
  return ans;
}
long long exp(long long x, long long ex) {
  long long ans = 1ll;
  while (ex > 0) {
    if (ex & 1ll) ans = (ans * x);
    ex >>= 1ll;
    x = (x * x);
  }
  return ans;
}
long long nCrModp(long long n, long long r, long long p) {
  long long C[r + 1];
  memset(C, 0, sizeof(C));
  C[0] = 1;
  for (long long i = 1; i <= n; i++) {
    for (long long j = min(i, r); j > 0; j--) C[j] = (C[j] + C[j - 1]) % p;
  }
  return C[r];
}
bool isPrime(long long n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (long long i = 5; i * i <= n; i = i + 6)
    if (n % i == 0 || n % (i + 2) == 0) return false;
  return true;
}
vector<long long> countFreq(long long arr[], long long n) {
  unordered_map<long long, long long> mp;
  vector<long long> v;
  for (long long i = 0; i < n; i++) mp[arr[i]]++;
  for (auto x : mp) v.push_back(x.second);
  return v;
}
long long binarySearch(long long arr[], long long l, long long r, long long x) {
  while (l <= r) {
    long long m = l + (r - l) / 2;
    if (arr[m] == x) return m;
    if (arr[m] < x)
      l = m + 1;
    else
      r = m - 1;
  }
  return -1;
}
bool sort_cond(const pair<long long, long long> &a,
               const pair<long long, long long> &b) {
  return a.second > b.second;
}
const long long MAXSIEVE = (1e3);
long long spf[MAXSIEVE];
void sieve() {
  spf[1] = 1;
  for (long long i = 2; i < MAXSIEVE; i++) spf[i] = i;
  for (long long i = 4; i < MAXSIEVE; i += 2) spf[i] = 2;
  for (long long i = 3; i * i < MAXSIEVE; i++) {
    if (spf[i] == i) {
      for (long long j = i * i; j < MAXSIEVE; j += i)
        if (spf[j] == j) spf[j] = i;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    if (n == 2)
      cout << 2 << endl;
    else {
      long long a = n / 2;
      long long sum = 0;
      sum += exp(2, n);
      for (long long i = (n - 1); i > (long long)(0); i--) {
        if (i >= n / 2)
          sum -= exp(2, i);
        else
          sum += exp(2, i);
      }
      cout << abs(sum) << endl;
    }
  }
}
