login
a(n) = C(n+2,3) + 2*C(n,2) + 2*(n-2).
2

%I #33 Aug 10 2023 17:39:05

%S -1,6,18,36,61,94,136,188,251,326,414,516,633,766,916,1084,1271,1478,

%T 1706,1956,2229,2526,2848,3196,3571,3974,4406,4868,5361,5886,6444,

%U 7036,7663,8326,9026,9764,10541,11358,12216,13116,14059,15046,16078,17156,18281,19454,20676

%N a(n) = C(n+2,3) + 2*C(n,2) + 2*(n-2).

%H Vincenzo Librandi, <a href="/A034857/b034857.txt">Table of n, a(n) for n = 1..1000</a>

%H J. Riordan, <a href="http://dx.doi.org/10.1147/rd.45.0473">Enumeration of trees by height and diameter</a>, IBM J. Res. Dev. 4 (1960), 473-478.

%H <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (4,-6,4,-1).

%F a(n) = (n^3 + 9n^2 + 8n - 24)/6. - _Ralf Stephan_, Feb 15 2004

%F From _Colin Barker_, Sep 09 2012: (Start)

%F a(n) = 4*a(n-1) -6*a(n-2) +4*a(n-3) -a(n-4).

%F G.f.: x*(-1 +10*x -12*x^2 +4*x^3)/(1- x)^4. (End)

%t Table[(n^3 + 9n^2 + 8n - 24)/6,{n, 1, 60}] (* _Vincenzo Librandi_, Sep 09 2012 *)

%t LinearRecurrence[{4,-6,4,-1},{-1,6,18,36},50] (* _Harvey P. Dale_, Aug 10 2023 *)

%o (Magma) [(n^3 + 9*n^2 + 8*n - 24)/6: n in [1..40]] // _Vincenzo Librandi_, Sep 09 2012

%o (PARI) for(n=1,50, print1((n^3+9*n^2+8*n-24)/6, ", ")) \\ _G. C. Greubel_, Feb 22 2018

%K sign,easy

%O 1,2

%A _N. J. A. Sloane_