#include <bits/stdc++.h>
using namespace std;
long long int n, k;
long long int two[33];
void prep() {
  two[0] = 1;
  for (int i = 1; i < 33; i++) {
    two[i] = two[i - 1] * 2;
  }
}
int main() {
  prep();
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    long long ans1 = 0, ans2 = two[n];
    for (int i = 1; i <= n; i++) ans1 += two[i];
    for (int i = 1; i <= n / 2 - 1; i++) ans2 += two[i];
    ans1 = ans1 - ans2;
    cout << abs(ans1 - ans2) << endl;
    ;
  }
}
