#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  long long int a[31] = {0};
  a[0] = 1;
  for (int i = 1; i <= 30; i++) a[i] = a[i - 1] * 2;
  while (t--) {
    int n;
    cin >> n;
    long long int s1 = 0, s2 = 0;
    int k = n / 2;
    for (int i = 1; i < n / 2; i++) s1 += a[i];
    s1 += a[n];
    for (int i = n / 2; i < n; i++) s2 += a[i];
    cout << abs(s1 - s2) << "\n";
  }
}
