sum j+j^2, j=1 to n