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