#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5 + 5;
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    long long ans = 0;
    for (long long i = n; i >= 1; i--) {
      if (i == n || i <= n / 2 - 1)
        ans += (1LL << i);
      else
        ans -= (1LL << i);
    }
    cout << ans << "\n";
  }
  return 0;
}
