#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, n;
  cin >> t;
  while (t--) {
    cin >> n;
    int a = 0, b = 0, k = 2;
    for (int i = 0; i < n / 2 - 1; i++) {
      a += k;
      k *= 2;
    }
    for (int i = 0; i < n / 2; i++) {
      b += k;
      k *= 2;
    }
    a += k;
    cout << abs(a - b) << endl;
  }
}
