|
|
A067056
|
|
a(n) = (1)*(2 + 3 + 4 + ... + n) + (1 + 2)*(3 + 4 + 5 + ... + n) + (1 + 2 + 3)*(4 + 5 + 6 + ... + n) + ... + (1 + 2 + 3 + ... + n-1)*n.
|
|
3
|
|
|
1, 2, 14, 54, 154, 364, 756, 1428, 2508, 4158, 6578, 10010, 14742, 21112, 29512, 40392, 54264, 71706, 93366, 119966, 152306, 191268, 237820, 293020, 358020, 434070, 522522, 624834, 742574, 877424, 1031184, 1205776, 1403248, 1625778, 1875678, 2155398, 2467530
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
LINKS
|
|
|
FORMULA
|
a(n) = Sum_{r=1..n-1} t(r)*(t(n) - t(r)), where t(r) is the r-th triangular number, n>1.
a(n) = n*(2*n^4 + 5*n^3 - 5*n - 2)/60 = (n-1)*n*(n+1)*(n+2)*(2*n+1)/60, n>1. - Ralf Stephan, Apr 30 2004
G.f.: x*(1 - 4*x + 17*x^2 - 20*x^3 + 15*x^4 - 6*x^5 + x^6) / (1 - x)^6.
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>7.
(End)
|
|
EXAMPLE
|
a(4) = (1)*(2+3+4) + (1+2)*(3+4) + (1+2+3)*(4) = 9 + 21 + 24 = 54.
|
|
MATHEMATICA
|
Join[{1}, Table[Total[Total[#[[1]]Total[#[[2]]]]&/@Table[TakeDrop[ Range[ k], n], {n, k-1}]], {k, 2, 40}]] (* Requires Mathematica version 10 or later *) (* or *) LinearRecurrence[{6, -15, 20, -15, 6, -1}, {1, 2, 14, 54, 154, 364, 756}, 40] (* Harvey P. Dale, Jul 17 2020 *)
|
|
PROG
|
(PARI) t(n) = n*(n+1)/2;
a(n) = if (n=1, 1, sum(k=1, n-1, t(k)*(t(n) - t(k)))); \\ Michel Marcus, Mar 06 2018
(PARI) Vec(x*(1 - 4*x + 17*x^2 - 20*x^3 + 15*x^4 - 6*x^5 + x^6) / (1 - x)^6 + O(x^60)) \\ Colin Barker, Mar 06 2018
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|