#include <bits/stdc++.h>
using namespace std;
const int MAX = 5e5 + 10, mod = 1e9 + 9, base = 41, INF = 1e9 + 10, sq = 502;
int solve() {
  long long n;
  cin >> n;
  long long sum = 0;
  for (int i = 1; i < (n / 2); i++) {
    sum += pow(2, i);
  }
  sum += pow(2, n);
  long long c = 0;
  for (int i = (n / 2); i < n; i++) {
    c += pow(2, i);
  }
  long long ans = abs(c - sum);
  cout << ans << endl;
  return 0;
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL);
  long long t = 1;
  cin >> t;
  while (t--) solve();
  return 0;
}
