What is the number of full binary trees of height less than $h$

Here is my contribution to this interesting discussion. Introduce $T_{\le n}(z)$ the OGF of full binary trees of height at most $n$ by the number of nodes. Now a tree of height at most $n$ either has height at most $n-1$ or height exactly $n.$ The latter tree has a subtree of height $n-1$ on the left or the right of the root node or the root has two children of height $n-1.$ This gives $$T_{\le n} = T_{\le n-1} + 2z (T_{\le n-1}-T_{\le n-2})T_{\le n-2} + z(T_{\le n-1}-T_{\le n-2})^2$$ where $T_{\le 0} = 1$ and $T_{\le 1} = z+1.$ Observe that $$T_{=n} = T_{\le n} - T_{\le n-1}.$$ Some algebra produces the simplified form $$T_{\le n} = T_{\le n-1} + z T_{\le n-1}^2 - z T_{\le n-2}^2.$$ This produces e.g. the following generating function for trees of height at most four by the number of nodes: $${z}^{15}+8\,{z}^{14}+28\,{z}^{13}+60\,{z}^{12}+94\,{z}^{11} +116\,{z}^{10}\\+114\,{z}^{9}+94\,{z}^{8}+69\,{z}^{7} +44\,{z}^{6}+26\,{z}^{5}+14\,{z}^{4}+5\,{z}^{3}+2\,{z}^{2}+z+1.$$ For the count compute the sequence $T_{\le n}(1)$ which yields $$1, 2, 5, 26, 677, 458330, 210066388901, 44127887745906175987802,\\ 1947270476915296449559703445493848930452791205,\ldots$$ This is OEIS A003095 and has closed form recurrence $$t_n = t_{n-1} + t_{n-1}^2-t_{n-2}^2$$ with $t_0=1$ and $t_1=2.$ The number of trees of height exactly $n$ is given by $$t_n-t_{n-1}$$ which gives the sequence $$1, 3, 21, 651, 457653, 210065930571, 44127887745696109598901,\\ 1947270476915296449559659317606103024276803403,\ldots$$ which is OEIS A001699.

Remark. Reviewing this post several years later we see that we have not employed the definition of a full binary tree as shown e.g. at Wikipedia because we admit trees where one of the children is a leaf. But the OEIS says we have the right values, how to explain this. We can count full binary trees by not admitting leaves (trees of size zero) so that $T_{\le 0}(z)=0$ and $T_{\le 1}(z) = z.$ This gives starting values for the recurrence as $0$ and $1$ with the next value being $2.$ However $1$ and $2$ are the starting values for ordinary binary trees, which explains the matching values (shift sequence and prepend a zero term). Hence the above calculation goes through. (Note: we take height zero to be the height of a leaf and height one the height of a singleton.)


(Partial Answer) First, $N(3)=21$. Second, and probably more useful, you can construct all the trees of height $h$ by adding two children to every non-empty subset of lowest vertices on a tree of height $h-1$. So, if at height $h-1$ you have trees $T_{1},...,T_{n}$ and tree $T_{i}$ has $v_{i}$ vertices on the lowest level, then the number of trees on level $h$ is

$$\sum_{i=1}^{n} (2^{v_{i}}-1).$$

Unfortunately, it seems to be not clear how to count how many leaves are at the lowest level in the newly constructed trees. This does provide an algorithm for constructing all such trees though.