This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A120982 #10 Nov 16 2019 10:32:26 %S A120982 1,3,9,3,28,27,93,162,18,333,825,270,1272,3915,2430,135,5085,18144, %T A120982 17199,2835,20925,84000,106596,34020,1134,87735,391554,612360,308448, %U A120982 30618,372879,1838295,3369600,2364390,459270,10206,1602450,8674380 %N A120982 Triangle read by rows: T(n,k) is the number of ternary trees with n edges and having k vertices of outdegree 2 (n >= 0, k >= 0). %C A120982 A ternary tree is a rooted tree in which each vertex has at most three children and each child of a vertex is designated as its left or middle or right child. %F A120982 T(n,k) = (1/(n+1))*binomial(n+1,k)*Sum_{j=0..floor(n/2)-k} 3^(n-k-3j)*binomial(n+1-k, k+1+2j)*binomial(n-2k-2j, j). %F A120982 G.f.: G = G(t,z) satisfies G = 1 + 3zG + 3tz^2*G^2 + z^3*G^3. %F A120982 Row n has 1+floor(n/2) terms. %F A120982 Row sums yield A001764. %F A120982 T(n,0) = A120985(n). %F A120982 Sum_{k>=1} k*T(n,k) = 3*binomial(3n,n-2) = 3*A003408(n-2). %e A120982 T(2,1)=3 because we have (Q,L,M), (Q,L,R) and (Q,M,R), where Q denotes the root and L (M,R) denotes a left (middle, right) child of Q. %e A120982 Triangle starts: %e A120982 1; %e A120982 3; %e A120982 9, 3; %e A120982 28, 27; %e A120982 93, 162, 18; %e A120982 333, 825, 270; %p A120982 T:=(n,k)->(1/(n+1))*binomial(n+1,k)*sum(3^(n-k-3*q)*binomial(n+1-k,k+1+2*q)*binomial(n-2*k-2*q,q),q=0..n/2-k):for n from 0 to 12 do seq(T(n,k),k=0..floor(n/2)) od; # yields sequence in triangular form %Y A120982 Cf. A001764, A003408, A120429, A120981, A120983, A120985. %K A120982 nonn,tabf %O A120982 0,2 %A A120982 _Emeric Deutsch_, Jul 21 2006