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