#include <bits/stdc++.h>
using namespace std;
const int INF = 1e+18;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int t;
  cin >> t;
  while (t--) {
    int n;
    long long left = 0, right = 0;
    cin >> n;
    int l = 1, r = n, hlf = n / 2;
    int i = n - 1;
    for (; i >= hlf; i--) right += pow(2, i);
    left += pow(2, n);
    for (; i > 0; i--) left += pow(2, i);
    cout << abs(right - left);
    cout << "\n";
    ;
  }
  return 0;
}
