#include <bits/stdc++.h>
using namespace std;
long long num[35];
int main() {
  int t;
  num[1] = 2;
  for (int i = 2; i <= 30; i++) num[i] = num[i - 1] * 2;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    long long sum = num[n];
    if (n == 2)
      cout << num[2] - num[1] << endl;
    else {
      for (int i = 1; i <= (n / 2) - 1; i++) sum = sum + num[i];
      for (int i = (n / 2); i < n; i++) sum = sum - num[i];
      cout << sum << endl;
    }
  }
}
