#include <bits/stdc++.h>
const int N = 1e6 + 5;
int n;
int a[N];
int main() {
  int T;
  scanf("%d", &T);
  while (T--) {
    scanf("%d", &n);
    int re = 0;
    for (int i = 1; i < n / 2; i++) re += 1 << i;
    re += 1 << n;
    for (int i = n / 2; i < n; i++) re -= 1 << i;
    printf("%d\n", abs(re));
  }
}
