#include<iostream>#include<cmath>using namespace std;int main(void){ int n,m,sum; cin>>m; while(m--) { cin>>n; sum=pow(2,n-1)+(n-1)*pow(2,n-2); cout<<sum<<endl; } return 0;}