#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  long long s = pow(2, n + 1) - 2;
  long long s1 = pow(2, n) + pow(2, n / 2) - 2;
  long long ans = 2 * s1 - s;
  cout << ans << endl;
  return;
}
int main() {
  int t;
  cin >> t;
  while (t--) solve();
  return 0;
}
