#include <bits/stdc++.h>
using namespace std;
int n;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    int x;
    cin >> x;
    int sum1 = (1 << x), sum2 = 0;
    for (int i = 1; i < x / 2; i++) sum1 += (1 << i);
    for (int i = x / 2; i < x; i++) sum2 += (1 << i);
    cout << sum1 - sum2 << '\n';
  }
  return 0;
}
