OFFSET
1,2
REFERENCES
I. P. Goulden and D. M. Jackson, Combinatorial Enumeration, John Wiley and Sons, N.Y., 1983.
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..400
David Callan, A sign-reversing involution to count labeled lone-child-avoiding trees, arXiv:1406.7784 [math.CO], (30-June-2014).
Eric Weisstein's World of Mathematics, Series-reduced tree.
FORMULA
a(n) = n*(n-2)!*Sum_{k=0..n-2} (-1)^k*binomial(n, k)*(n-k)^(n-k-2)/(n-k-2)!, n>1.
E.g.f.: x*(exp( - LambertW(-x/(1+x))) - (LambertW(-x/(1+x))/2 )^2).
a(n) ~ n^(n-1) * (1-exp(-1))^(n+1/2). - Vaclav Kotesovec, Oct 05 2013
E.g.f.: -(1+x)*LambertW(-x/(1+x)) - (x/2)*LambertW(-x/(1+x))^2. - G. C. Greubel, Mar 07 2020
EXAMPLE
From Gus Wiseman, Jan 22 2020: (Start)
The a(1) = 1 through a(4) = 16 trees (in the format root[branches], empty column shown as dot) are:
1 1[2] . 1[2,3,4]
2[1] 1[2[3,4]]
1[3[2,4]]
1[4[2,3]]
2[1,3,4]
2[1[3,4]]
2[3[1,4]]
2[4[1,3]]
3[1,2,4]
3[1[2,4]]
3[2[1,4]]
3[4[1,2]]
4[1,2,3]
4[1[2,3]]
4[2[1,3]]
4[3[1,2]]
(End)
MAPLE
seq( `if`(n=1, 1, n*(n-2)!*add((-1)^k*binomial(n, k)*(n-k)^(n-k-2)/(n-k-2)!, k=0..n-2)), n=1..20); # G. C. Greubel, Mar 07 2020
MATHEMATICA
f[n_] := If[n < 2, 1, n(n - 2)!Sum[(-1)^k*Binomial[n, k](n - k)^(n - 2 - k)/(n - 2 - k)!, {k, 0, n - 2}]]; Table[ f[n], {n, 19}] (* Robert G. Wilson v, Feb 12 2005 *)
sps[{}]:={{}}; sps[set:{i_, ___}]:=Join@@Function[s, Prepend[#, s]&/@sps[Complement[set, s]]]/@Cases[Subsets[set], {i, ___}];
lrt[set_]:=If[Length[set]==0, {}, Join@@Table[Apply[root, #]&/@Join@@Table[Tuples[lrt/@stn], {stn, sps[DeleteCases[set, root]]}], {root, set}]];
Table[Length[Select[lrt[Range[n]], Length[#]!=2&&FreeQ[Z@@#, _Integer[_]]&]], {n, 6}] (* Gus Wiseman, Jan 22 2020 *)
PROG
(Magma) [1] cat [n*Factorial(n-2)*(&+[(-1)^k*Binomial(n, k)*(n-k)^(n-k-2)/Factorial(n-k-2): k in [0..n-2]]): n in [2..20]]; // G. C. Greubel, Mar 07 2020
(Sage) [1]+[n*factorial(n-2)*sum((-1)^k*binomial(n, k)*(n-k)^(n-k-2)/factorial( n-k-2) for k in (0..n-2)) for n in (2..20)] # G. C. Greubel, Mar 07 2020
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Vladeta Jovovic, Mar 27 2001
STATUS
approved