sum (3i^2-i-n^2),i=0 to n]