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