#include <bits/stdc++.h>
using namespace std;
int main() {
  long long power_2[31];
  power_2[0] = 1;
  for (long long i = 1; i <= 30; i++) {
    power_2[i] = power_2[i - 1] * 2;
  }
  long long t, n;
  long long a = 0, b = 0, sum = 0, ac = 0;
  cin >> t;
  while (t--) {
    sum = 0;
    a = 0;
    b = 0;
    cin >> n;
    a += power_2[n];
    ac = 1;
    for (int i = 1; i < n; i++) {
      if (ac * 2 < n) {
        a += power_2[i];
        ac++;
      } else {
        b += power_2[i];
      }
    }
    if (a > b)
      sum = a - b;
    else
      sum = b - a;
    std::cout << sum << std::endl;
  }
}
