#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long int n;
  cin >> n;
  long long int a = 1;
  long long int total = 0;
  for (long long int i = 1; i <= n; i++) total += (1 << i);
  long long int sub = 0;
  long long int p = 1;
  long long int t = n / 2;
  sub += (1 << n);
  t--;
  while (t) {
    sub += (1 << p);
    p++;
    t--;
  }
  cout << abs(total - 2 * sub) << endl;
}
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
