1/2+1/4+1/8+……1/2N=(1-1/2)+(1/2-1/4)+……+(1/N-1/2N)
=1-1/2N
1+2+3+4+……+N=N(N+1)/2
所以原式=(1-1/2N)+(N(N+1)/2)