By thy way:
sum(i=1..n) i*i = n/6 + n^2/2 + n^3/3
sum bla= n(n+1)(2n+1)/6, then you go distribute
I know that this sum can be expressed as a cubic polynomial. So I just evaluated the sum at four data-points (n=0,1,2,3) and used those to determine the four coefficents by solving a linear equation system.