#include <bits/stdc++.h>
using namespace std;
int main(int argc, char** argv) {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout << setprecision(15);
  if (argc == 2 && atoi(argv[1]) == 123456789)
    freopen("d:\\code\\cpp\\contests\\stdin", "r", stdin);
  int T;
  cin >> T;
  for (int(t) = 0; (t) < (T); (t)++) {
    int n;
    cin >> n;
    int all = (1 << (n + 1)) - 2;
    int a = 1 << n;
    for (int(i) = 1; (i) <= (n / 2 - 1); (i)++) {
      a += 1 << i;
    }
    int b = all - a;
    cout << abs(b - a) << endl;
  }
  if (argc == 2 && atoi(argv[1]) == 123456789)
    cout << clock() * 1.0 / CLOCKS_PER_SEC << " sec\n";
  return 0;
}
