OFFSET
1,2
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (6,-15,20,-15,6,-1).
FORMULA
From Colin Barker, Aug 07 2015: (Start)
a(n) = 6*a(n-1)-15*a(n-2)+20*a(n-3)-15*a(n-4)+6*a(n-5)-a(n-6) for n>6.
G.f.: x*(x^4+3*x^3+7*x^2+3*x+1) / (x-1)^6. (End)
E.g.f.: exp(x)*x*(24 + 84*x + 88*x^2 + 30*x^3 + 3*x^4)/24. - Stefano Spezia, May 14 2024
EXAMPLE
The first ten triangular numbers are 1,3,6,10,15,21,28,36,45,and 55. Take them in groups, respectively, of 1, 2, 3, and 4 = (1), (3, 6), (10, 15, 21), and (28, 36, 45, 55). Summing each group separately = 1, 9, 46, 164.
MATHEMATICA
Table[1/24*(8*x+13*x^3+3*x^5), {x, 50}]
Module[{nn=40}, Total/@TakeList[Accumulate[Range[(nn(nn+1))/2]], Range[nn]]] (* or *) LinearRecurrence[{6, -15, 20, -15, 6, -1}, {1, 9, 46, 164, 460, 1091}, 40] (* Harvey P. Dale, Aug 09 2023 *)
PROG
(PARI) Vec(x*(x^4+3*x^3+7*x^2+3*x+1)/(x-1)^6 + O(x^100)) \\ Colin Barker, Aug 07 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Harvey P. Dale, Jul 27 2015
STATUS
approved