I have two snippets of code that I am having a lot of trouble with finding the closed form Summations and time complexities for:

x=0;

for(i=1;i< pow(2,N); i = 2*i + 2){

for(j=1;j<N ; j++){

x=x+j;

}

}

and:

x=0;

for(i=1;i <= (2*n); i++){

for(j=1; j <= n; j++){

if(j<i) x=x+1;

}

}

Anyone have any idea how to solve those in closed form??