sum j^2-2j+2, j=1 to 50