OFFSET
1,2
LINKS
Index entries for linear recurrences with constant coefficients, signature (10,-45,120,-210,252,-210,120,-45,10,-1).
FORMULA
a(1)=1; a(n)=sum(i^s, {i, n(n-1)/2+1, n(n-1)/2+1+n}).
a(n) = (15n^9 + 90n^7 + 123n^5 + 20n^3 - 8n)/240.
G.f.: x*(1+87*x+1252*x^2+5533*x^3+8934*x^4+5533*x^5+1252*x^6+87*x^7+x^8)/ (1-x)^10. [Colin Barker, May 25 2012]
EXAMPLE
s=4; a(1) = 1^s = 1; a(2) = 2^s + 3^s = 2^4+3^4 = 97; a(3) = 4^s + 5^s + 6^s = 2177, a(4) = 7^s + 8^s + 9^s + 10^3 = 23058.
MATHEMATICA
i1 := n(n-1)/2+1; i2 := n(n-1)/2+n; s=4; Table[Sum[i^s, {i, i1, i2}], {n, 20}]
Table[Total[Range[(n(n+1))/2+1, ((n+1)(n+2))/2]^4], {n, 0, 20}] (* or *) LinearRecurrence[{10, -45, 120, -210, 252, -210, 120, -45, 10, -1}, {1, 97, 2177, 23058, 152979, 738835, 2839571, 9191876, 26037717, 66301333}, 30] (* Harvey P. Dale, Dec 18 2015 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Zak Seidov, Sep 24 2002
EXTENSIONS
Formula by Charles R Greathouse IV, Sep 17 2009
STATUS
approved