%I #18 Nov 01 2019 03:22:37
%S 1,2,5,17,83,577,5425,65221,959145,16703045,336294539,7687013743,
%T 196668883339,5568107204467,172833125462925,5836126964882633,
%U 212987232417299345,8353651173273885025,350415859403143234243,15654265239209850186247,741991467954126579131811
%N Number of forests of trees on n or fewer nodes using a subset of labels 1..n, also row sums of triangle A144258.
%H Alois P. Heinz, <a href="/A144259/b144259.txt">Table of n, a(n) for n = 0..150</a>
%H <a href="/index/Tra#trees">Index entries for sequences related to trees</a>
%F a(n) = Sum_{k=0..n} A144258(n,k).
%e a(2) = 5, because there are 5 forests of trees on 2 or fewer nodes using a subset of labels 1,2:
%e ..... ..... ..... ..... .....
%e ..... .1... ...2. .1.2. .1-2.
%e ..... ..... ..... ..... .....
%p T:= proc(n,k) option remember; if k=0 then 2^n elif k<0 or n<=k then 0 elif k=n-1 then n^(n-2) else add(binomial(n-1, j) *T(j+1, j) *T(n-1-j, k-j), j=0..k) fi end: a:= n-> add(T(n,k), k=0..n): seq(a(n), n=0..20);
%t T[n_, k_] := T[n, k] = Which[k==0, 2^n, k<0 || n <= k, 0, k==n-1, n^(n-2), True, Sum[Binomial[n-1, j]*T[j+1, j]*T[n-1-j, k-j], {j, 0, k}]]; a[n_] := Sum[T[n, k], {k, 0, n}]; Table[a[n], {n, 0, 20}] (* _Jean-François Alcover_, Feb 25 2017, translated from Maple *)
%Y Cf. A144258, A007318, A000142.
%K nonn
%O 0,2
%A _Alois P. Heinz_, Sep 16 2008