OFFSET
0,1
COMMENTS
Also number of ordered trees with n+4 edges, having exactly two branch nodes (i.e., vertices of outdegree at least two).
LINKS
Colin Barker, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (9,-33,63,-66,36,-8).
FORMULA
a(n) = (n^2 + 9*n + 20)/2 + 2^(n+1)*(n^2 + 3*n - 4).
G.f.: (2 - 3*x)/((1 - 2*x)^3*(1 - x)^3).
a(n) = 9*a(n-1) - 33*a(n-2) + 63*a(n-3) - 66*a(n-4) + 36*a(n-5) - 8*a(n-6) for n>5. - Colin Barker, Apr 09 2019
EXAMPLE
a(0)=2 because the only Dyck paths of semilength 4 that have exactly two long ascents are UUDDUUDD and UUDUUDDD (here U=(1,1) and D=(1,-1)).
MATHEMATICA
LinearRecurrence[{9, -33, 63, -66, 36, -8}, {2, 15, 69, 252, 804, 2349}, 30] (* Harvey P. Dale, Jul 01 2020 *)
PROG
(PARI) Vec((2 - 3*x) / ((1 - x)^3*(1 - 2*x)^3) + O(x^40)) \\ Colin Barker, Apr 09 2019
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Emeric Deutsch, Feb 22 2004
STATUS
approved