1+2+\cdots+n=\left(\frac{n-1}{2}\right)^2