A120983 Triangle read by rows: T(n,k) is the number of ternary trees with n edges and having k vertices of outdegree 3 (n >= 0, k >= 0).
1, 3, 12, 54, 1, 261, 12, 1323, 105, 6939, 810, 3, 37341, 5859, 63, 205011, 40824, 840, 1143801, 277830, 9072, 12, 6466230, 1861380, 86670, 360, 36960300, 12335895, 764478, 6435, 213243435, 81120204, 6377778, 89100, 55, 1240219269, 530408736
Offset: 0
Examples
T(3,1)=1 because we have (Q,L,M,R), where Q denotes the root and L (M,R) denotes a left (middle, right) child of Q. Triangle starts: 1; 3; 12; 54, 1; 261, 12; 1323, 105; 6939, 810, 3;
Programs
-
Maple
T:=(n,k)->(1/(n+1))*binomial(n+1,k)*sum(3^j*binomial(n+1-k,j)*binomial(j,n-3*k-j),j=0..n+1-k): for n from 0 to 14 do seq(T(n,k),k=0..floor(n/3)) od; # yields sequence in triangular form
Comments