sum from 1 to n of x^2