#include <bits/stdc++.h>
using namespace std;
const int maxn = 100010;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 0;
  long long int n = 0ll;
  cin >> t;
  while (t--) {
    cin >> n;
    long long int sum = 0ll;
    for (int i = n - 1; i >= n / 2; --i) sum += (1ll << i);
    long long int sum1 = 2ll * ((1ll << n) - 1ll) - sum;
    cout << abs(sum - sum1) << endl;
  }
}
