3*(1+2+3+4+.n)-n =3*(1+n)*n/2-n =(3n^2+n)/2 How to simplify to the last step

3*(1+2+3+4+.n)-n =3*(1+n)*n/2-n =(3n^2+n)/2 How to simplify to the last step

The solution is 3 * (1 + 2 + 3 + 4 +. N) - n = 3 * (1 + n) * n / 2-n
=(3n+3n^2)/2-n
=(3n+3n^2)/2-2n/2
=(3n+3n^2-2n)/2
=(3n^2+n)/2