
# include <fstream>
# include <iostream>
# include <string>
# include <vector>
# include <math.h>
# include <climits>
using namespace std;

int main(){
	ifstream in("STAIRS.IN");
	int I,T;
	in>>T;
	for(I=0;I<T;I++){
		int i,j,N;
		long long ans=0;
		in>>N;
		long long p=1;
		for(i=1;i<=N/2;i++){
			p*=4;
			int step=1;
			for(j=0;j<1<<(N-i);j++){
				int count=0,t=j;
				while(t>0){
					if(t%2==1)
						count++;
					t/=2;
				}
				if(count==i)
					ans+=p;
			}
		}
		cout<<ans+1<<endl;
	}
	system("pause");
	return 0;
}
