I'm trying to understand the algorithm for insert sort for efficiency.

Why does 2 + 2 x 2 + .... 2 X(n-1) = n squared - n?

what's the relationship between the two?

thanks.