#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    long long int res = 0;
    res += (1LL << n);
    for (int i = 1; i < n / 2; i++) {
      res += (1LL << i);
    }
    for (int i = n - 1; i >= n / 2; i--) {
      res -= (1LL << i);
    }
    cout << res << '\n';
  }
}
