#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
int 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 cnt = 0, sm1 = 0, sm2 = 0;
    for (long long i = 1; i < n / 2; i += 1) {
      sm1 += (1ll << i);
    }
    sm1 += (1ll << n);
    sm2 = (1ll << (n + 1)) - 2 - sm1;
    cout << abs(sm1 - sm2) << endl;
  }
  return 0;
}
