Table[n^2,{n,1,10}]

Sum[n^2,{n,1,10}]

Table[Sum[n^2,{n,1,k}],{k,1,10}]

Table[(1/6)(n(n+1)(2n+1)),{n,1,10}]

Spencer[n_]:=1+(1/2)(1/6)((n-1)(n)(2(n-1)+1))+(1/2)(1/2)(n(n-1))+n

Spencer[5]

Table[Spencer[x],{x,0,10}]

Marvelia[n_]:=1+(1/6)(n(n-1)/2)^2+(5/6)(n(n-1)/2)+n

Table[Marvelia[x],{x,0,10}]

Expand[1+(1/6)(n(n-1)/2)^2+(5/6)(n(n-1)/2)+n]