\[n=a_{1}+2a_{2}+\cdots+na_{n},\]