[seqfan] Re: G.f. for trees with degree at most 3

Douglas McNeil mcneil at hku.hk
Mon May 24 03:38:27 CEST 2010

On Mon, May 24, 2010 at 5:51 AM, franktaw at netscape.net
<franktaw at netscape.net> wrote:
> I asked the author of this sequence for clarification, but got no
> response. Maybe somebody here can figure out what is going on.
>
> http://www.research.att.com/~njas/sequences/A003692
>
> For this sequence, a generating function is given:
>
> (1-x)(2-x-x^2) - (2-x+x^2)\sqrt{1-2x-x^2} \over 3 x^3.
>
> I'm not sure if this is supposed to be
>
> (1-x)*(2-x-x^2)-(2-x-x^2)*sqrt(1-2*x-x^2)/(3*x^3)
>
> or
>
> ((1-x)*(2-x-x^2)-(2-x-x^2)*sqrt(1-2*x-x^2))/(3*x^3),

Seems to work for me:

sage: gf = ((1-x)*(2-x-x**2) - (2-x+x**2)*(1-2*x-x**2)**(1/2)) / (3*x**3)
sage: c = taylor(gf, x, 0, 12).coefficients()
sage: c
[[1, 0], [1, 1], [3/2, 2], [8/3, 3], [5, 4], [39/4, 5], [469/24, 6],
[40, 7], [333/4, 8], [1405/8, 9], [5995/16, 10], [807, 11], [42055/24,
12]]
sage: sq = [a*factorial(b) for a,b in cc]
sage: sq
[1, 1, 3, 16, 120, 1170, 14070, 201600, 3356640, 63730800, 1359666000,
32212857600, 839350512000]

Doug

--
Department of Earth Sciences
University of Hong Kong