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