#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a, b, c, d, e, f, g, h, i, j, k;
  cin >> a;
  while (a--) {
    long long sum = 0, sum1 = 0;
    cin >> b;
    for (i = 1; i < b / 2; i++) sum = sum + pow(2, i);
    sum = sum + pow(2, b);
    for (i = b / 2; i < b; i++) sum1 = sum1 + pow(2, i);
    cout << abs(sum - sum1) << endl;
  }
}
