#include <bits/stdc++.h>
#pragma GCC optimize("O3")
const int INF = 1e9;
const int MOD = 1e9 + 7;
const int N = 1e5;
using namespace std;
int mas[1005];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int q;
  cin >> q;
  for (int i = 1; i <= 30; i++) {
    mas[i] = (1 << i);
  }
  while (q--) {
    int n, x, s1 = 0, s2 = 0;
    cin >> n;
    x = n / 2;
    for (int i = 1; i <= n / 2 - 1; i++) {
      s1 += mas[i];
    }
    s1 += mas[n];
    for (int i = n / 2; i < n; i++) {
      s2 += mas[i];
    }
    cout << abs(s1 - s2) << "\n";
  }
  return 0;
}
