#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t;
  cin >> t;
  while (t--) {
    long long n, i, j, s = 0, r = 0, q = 0;
    cin >> n;
    s = pow(2, n);
    r = 2 * (pow(2, n / 2 - 1) - 1);
    q = 2 * (pow(2, n) - 1);
    cout << abs(s + r - (q - (s + r))) << "\n";
  }
}
