#include <bits/stdc++.h>
int main() {
  int t, n;
  long s1, s2;
  scanf("%d", &t);
  for (int i = 0; i < t; i++) {
    s1 = 0;
    s2 = 0;
    scanf("%d", &n);
    for (int j = n / 2; j < n; j++) {
      s1 += pow(2, j);
    }
    for (int j = 1; j < n / 2; j++) {
      s2 += pow(2, j);
    }
    s2 += pow(2, n);
    printf("%ld\n", s2 - s1);
  }
  return 0;
}
