#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.sync_with_stdio(false);
  cin.tie(0);
  int T;
  cin >> T;
  while (T--) {
    int n;
    cin >> n;
    int r = 1 << n;
    for (int i = 1; i < (n >> 1); ++i) r += 1 << i;
    for (int i = (n >> 1); i < n; ++i) r -= 1 << i;
    cout << r << endl;
  }
  return 0;
}
