#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    long long a = 0, b = 0;
    long long counta = 0, countb = 0;
    for (long long i = n; i >= 1; i--) {
      if (i == n) {
        a += pow(2, i);
        counta++;
      } else if (a > b) {
        if (countb == n / 2) {
          a += pow(2, i);
          counta++;
        } else {
          b += pow(2, i);
          countb++;
        }
      } else {
        if (counta == n / 2) {
          b += pow(2, i);
          countb++;
        } else {
          a += pow(2, i);
          counta++;
        }
      }
    }
    cout << abs(a - b) << endl;
  }
}
