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