#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int out = 0;
  bool flag = false;
  register char cc = getchar();
  while (cc < '0' || cc > '9') {
    if (cc == '-') flag = true;
    cc = getchar();
  }
  while (cc >= '0' && cc <= '9') {
    out = (out << 3) + (out << 1) + (cc ^ 48);
    cc = getchar();
  }
  return flag ? -out : out;
}
inline void write(int x) {
  if (x < 0) putchar('-'), x = -x;
  if (x == 0)
    putchar('0');
  else {
    int num = 0;
    char cc[20];
    while (x) cc[++num] = x % 10 + 48, x /= 10;
    while (num) putchar(cc[num--]);
  }
  putchar('\n');
}
int T, n;
long long sum, ans;
int main() {
  for (T = read(); T; T--) {
    n = read(), sum = ans = 0;
    for (int i = 1; i <= n; i++) {
      sum += 1ll << i;
      if (i < (n / 2)) ans += 1ll << i;
    }
    ans += 1ll << n;
    ans = ans - (sum - ans);
    cout << ans << endl;
  }
  return 0;
}
