For a problem like that, "Newton's finite Difference" method, a variation on Taylor's polynomial works nicely.
Make a list of values and repeated differences:
n y(n) dy d2y d3y d4y
0 0 1 3 2 0
1 1 4 5 2
2 5 9 7
3 14 16
4 30
Where the number in each "difference" column is the difference between two successive numbers in the previous column. Of course, since the y value itself is gotten by adding squares, the first difference is just the square itself. The second differences are just odd numbers and the third differences are the same: 2. All succeeding differences are 0.
Newton's polynomial now is y+ (dy)n+ (d2y/2) n(n-1)+ (d3y/3!)n(n-1)(n-2)+ ... with the ith term being (diy)/n! n(n-1)..(n-i+1)
Here, that gives 0+ 1n+ (3/2)n(n-1)+ (2/6)n(n-1)(n-2)= (n/6)(6+ 9n- 9+ 2n[sup[/sup]-6n+ 4)= (1/6)n(2n2+3n+1)= (1/6)n(2n+1)(n+1).
One can show that the sum of "kth" powers is a polynomial of degree k+1.