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