#include <bits/stdc++.h>
using namespace std;
int main() {
  long long pow[31];
  long long sum[31];
  pow[0] = 1;
  sum[0] = 0;
  for (int i = 1; i < 31; ++i) {
    pow[i] = 2 * pow[i - 1];
    sum[i] = sum[i - 1] + pow[i];
  }
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  unsigned long long t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    cout << (pow[n] + 2 * sum[n / 2 - 1] - sum[n - 1]) << "\n";
  }
}
