OFFSET
1,2
LINKS
Colin Barker, Table of n, a(n) for n = 1..1000
Bünyamin Şahin, Level Polynomials of Rooted Trees, 2023.
Index entries for linear recurrences with constant coefficients, signature (6,-15,20,-15,6,-1).
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
a(n) = 2*A005585(n-1), n>1. - R. J. Mathar, May 20 2013
From Colin Barker, Mar 06 2018: (Start)
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
Amarnath Murthy, Jan 02 2002
EXTENSIONS
More terms from Jason Earls, Jan 11 2002
STATUS
approved