OFFSET
1,2
LINKS
T. D. Noe, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (12,-66,220,-495,792,-924,792,-495,220,-66,12,-1).
FORMULA
a(1) = 1; a(n) = sum(i^s, {i, n(n-1)/2+1, n(n-1)/2+1+n}).
a(n) = (3n^11 + 25n^9 + 53n^7 + 23n^5 - 8n^3)/96.
G.f.: x*(x^10 +263*x^9 +8691*x^8 +83454*x^7 +301932*x^6 +458718*x^5 +301932*x^4 +83454*x^3 +8691*x^2 +263*x+1) / (x-1)^12. [Colin Barker, Jul 22 2012]
EXAMPLE
s=5; a(1) = 1^s = 1; a(2) = 2^s + 3^s = 2^5 + 3^5 = 275; a(3) = 4^s + 5^s + 6^s = 11925, a(4) = 7^s + 8^s + 9^s + 10^3 = 208624.
MATHEMATICA
i1 := n(n-1)/2+1; i2 := n(n-1)/2+n; s=5; Table[Sum[i^s, {i, i1, i2}], {n, 20}]
nn=30; With[{p5=Range[((nn+1)(nn+2))/2]^5}, Join[{1}, Table[Total[Take[p5, {(n(n+1))/2+1, ((n+1)(n+2))/2}]], {n, nn}]]] (* Harvey P. Dale, Mar 09 2014 *)
Module[{nn=25, p5}, p5=Range[(nn(nn+1))/2]^5; Total/@TakeList[p5, Range[nn]]] (* Harvey P. Dale, Oct 13 2023 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Zak Seidov, Sep 24 2002
EXTENSIONS
Formula from Charles R Greathouse IV, Sep 17 2009
STATUS
approved