#include <bits/stdc++.h>
using namespace std;
int main() {
  int arr1[30];
  arr1[0] = 1;
  int i, t;
  cin >> t;
  for (i = 1; i <= 30; i++) {
    arr1[i] = 2 * arr1[i - 1];
  }
  while (t--) {
    int n;
    cin >> n;
    int sum1 = arr1[n];
    int sum2 = 0;
    int j, k;
    for (j = 1; j < n / 2; j++) {
      sum1 = sum1 + arr1[j];
    }
    for (k = n / 2; k < n; k++) {
      sum2 = sum2 + arr1[k];
    }
    cout << abs(sum1 - sum2) << endl;
  }
}
