#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long int lcm(long long int a, long long int b) {
  return (a * b) / gcd(a, b);
}
template <typename T>
T max3(T x, T y, T z) {
  return (max(max(x, y), z));
}
template <typename T>
T min3(T x, T y, T z) {
  return (min(min(x, y), z));
}
void required() {}
void solve() {
  long long int n, i, j, k, s, f;
  cin >> n;
  s = 2 * (pow(2, n) - 1);
  f = 1;
  long long int c1, c2, r;
  r = n;
  c1 = c2 = 0;
  c1 = pow(2, n);
  for (i = 1; i < (n / 2); i++) {
    c1 = c1 + pow(2, i);
  }
  for (i = n / 2; i <= n - 1; i++) {
    c2 = c2 + pow(2, i);
  }
  cout << abs(c2 - c1) << endl;
}
void solve_loop() {
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
}
int main() {
  required();
  solve_loop();
  return 0;
}
