tn=(1-1)*(1/2)^(1-2)+(2-1)*(1/2)^(2-2)+.+(n-1)*(1/2)^(n-2)
tn/2=(1-1)*(1/2)^(2-2)+(2-1)*(1/2)^(2-2)+.+(n-1)*(1/2)^(n-1)
tn-tn/2=0*(1/2)^(-1)+(1/2)^0+(1/2)^1+.+(1/2)^(n-2)-(n-1)*(1/2)^(n-1)
tn/2=[1-(1/2)^(n-1)]/(1-1/2)-(n-1)*(1/2)^(n-1)
tn=4*[1-(1/2)^(n-1)]-2*(n-1)*(1/2)^(n-1)
tn=4-2*(1/2)^(n-2)-(n-1)*(1/2)^(n-2)
tn=4-(n+1)*(1/2)^(n-2)