#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using db = double;
using vi = vector<int>;
const int inf = 0x3f3f3f3f;
const db eps = 1e-8;
const int mod = 1e9 + 7;
ll qpow(ll a, ll b) {
  ll ret = 1;
  while (b) {
    if (b & 1) ret = ret * a % mod;
    a = a * a % mod;
    b >>= 1;
  }
  return ret;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    ll l = 1, r = n;
    ll ans = 0;
    ans += 1 << n;
    for (int i = 1; i < n; ++i) {
      if (i < n / 2)
        ans += (1 << i);
      else
        ans -= (1 << i);
    }
    ans = abs(ans);
    cout << ans << "\n";
  }
}
