Question: Sum formula from series

Its difficult for me to explain what I'm looking for so I will try with an example:

Example 1

Is there anyway any function that will say for example the sum of squares of integers for a given n say n=4, 1^2 + 2^2 + 3^2 + 4^2 = 30 that will give the equation ((n^3)/3) + ((n^2)/2) + (n/6) that gives the sum for a given n?

It would be determined from the series 1^2 + 2^2 + 3^2 + 4^2 + ... or the equation for the elements 1^2, 2^2, 3^2, 4^2 the equation that gives the sum; in this case the well known ((n^3)/3) + ((n^2)/2) + (n/6) .

 

So far I've got FindSequenceFunction[{1, 4, 9, 16}, n] but this only finds the individual elements not an equation for the sum of them. Of course I already know the equation for producing the individual elements.

Please Wait...