#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, i, q, temp;
  double j, n;
  int x, y, a, b;
  long long int s1, s2;
  cin >> t;
  while (t--) {
    cin >> n;
    y = 0;
    s1 = pow(2.0, n);
    x = 1;
    s2 = 0;
    j = 1;
    while (x < n / 2) {
      s1 = s1 + pow(2.0, j);
      x += 1;
      j++;
    }
    while (y < n / 2) {
      s2 = s2 + pow(2.0, j);
      y += 1;
      j++;
    }
    cout << abs(s1 - s2) << "\n";
  }
  return 0;
}
