#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  for (int i = 0; i < t; i++) {
    int n;
    cin >> n;
    int a[n];
    for (int j = 1; j <= n; j++) {
      a[j] = pow(2, j);
    }
    int f = 0, s = 0;
    for (int j = 1; j <= n; j++) {
      if (j < n / 2 || j == n)
        f += a[j];
      else {
        s += a[j];
      }
    }
    cout << f - s << endl;
  }
  return 0;
}
