#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    long long p1 = 1 << n;
    long long p2 = 0;
    for (int i = 1; i < n; i++) {
      if (i + 1 <= n / 2) {
        p1 += (1 << i);
      } else {
        p2 += (1 << i);
      }
    }
    cout << abs(p1 - p2) << endl;
  }
}
