#include <bits/stdc++.h>
using namespace std;
int compare(const void *a, const void *b) {
  int A = *((int *)a);
  int B = *((int *)b);
  return A - B;
}
int main() {
  long long a, b, c = 0, d, i, j, k, n, m, p = 0, q = 0, r, t = 0, l[100000],
                  mid, sum[100000];
  char ch;
  cin >> t;
  while (t != 0) {
    cin >> n;
    p = pow(2, n);
    for (i = 1; i < n / 2; i++) p = p + pow(2, i);
    q = 0;
    for (i = n / 2; i < n; i++) q = q + pow(2, i);
    r = abs(q - p);
    cout << r << endl;
    t--;
  }
}
