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 (14,-91,364,-1001,2002,-3003,3432,-3003,2002,-1001,364,-91,14,-1).
FORMULA
a(1)=1; a(n)=sum(i^s, {i, n(n-1)/2+1, n(n-1)/2+1+n}).
a(n)=(21n^13 + 231n^11 + 693n^9 + 549n^7 - 126n^5 - 56n^3 + 32n)/1344.
G.f.: x*(x^12 +779*x^11 +55366*x^10 +1053755*x^9 +7499895*x^8 +23228658*x^7 +33620292*x^6 +23228658*x^5 +7499895*x^4 +1053755*x^3 +55366*x^2 +779*x +1)/(x-1)^14. [Colin Barker, Jul 22 2012]
EXAMPLE
s=6; a(1) = 1^s = 1; a(2) = 2^s + 3^s = 2^6 + 3^6 = 793; a(3) = 4^s + 5^s + 6^s = 66377, a(4) = 7^s + 8^s + 9^s + 10^3 = 1911234.
MATHEMATICA
i1 := n(n-1)/2+1; i2 := n(n-1)/2+n; s=6; Table[Sum[i^s, {i, i1, i2}], {n, 20}]
With[{nn=20}, Total/@TakeList[Range[(nn(nn+1))/2]^6, Range[nn]]] (* or *) LinearRecurrence[{14, -91, 364, -1001, 2002, -3003, 3432, -3003, 2002, -1001, 364, -91, 14, -1}, {1, 793, 66377, 1911234, 28504515, 271739011, 1874885963, 10136389172, 45311985069, 173957200405, 589679082421, 1802148522758, 5045944649967, 13108508706879}, 20] (* Harvey P. Dale, Mar 29 2022 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Zak Seidov, Sep 24 2002
EXTENSIONS
Formula from Charles R Greathouse IV, Sep 17 2009
STATUS
approved