#include<iostream>
#include<cmath>
using namespace std;
int dp[33];
int main()
{
int text;
cin>>text;
dp[1] = 1;
dp[2] = 2;
dp[3] = 5;
int i;
int sum = 0;
for(i = 4;i <30;i++)
{
sum = (int)pow(2.0,i-1);
dp[i] = sum + dp[i -2]; //规律
}
while(text--)
{
int n;
cin>>n;
cout<<dp[n]<<endl;
}
return 0;
}