#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1e9 + 7;
void go() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
int main() {
  go();
  long long int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    long long int s1, s2;
    s1 = s2 = 0;
    long long int i = 1, j = n;
    if (n == 2) {
      cout << "2\n";
      continue;
    }
    s1 |= (1 << n);
    for (int i = (int)(n - 1); i >= (int)(n / 2); i--) {
      s2 |= (1 << i);
    }
    for (int i = (int)(1); i <= (int)(n / 2 - 1); i++) {
      s1 |= (1 << i);
    }
    cout << abs(s1 - s2) << endl;
  }
  return 0;
}
