|
Search: id:A019497
|
|
|
| A019497 |
|
Number of ternary search trees on n keys. |
|
+0 5
|
|
| 1, 1, 1, 3, 6, 16, 42, 114, 322, 918, 2673, 7875, 23457, 70551, 213846, 652794, 2004864, 6190612, 19207416, 59850384, 187217679, 587689947, 1850692506, 5845013538, 18509607753, 58759391013, 186958014766, 596108115402
(list; graph; listen)
|
|
|
OFFSET
|
0,4
|
|
|
REFERENCES
|
J. A. Fill and R. P. Dobrow, The number of m-ary search trees on n keys, Combin. Probab. Comput. 6 (1997), 435-453.
|
|
LINKS
|
Index entries for sequences related to rooted trees
|
|
FORMULA
|
a(0)=a(1)=1 and for n>=2 a(n)= sum( i+j+k=n-2, a(i)*a(j)*a(k) ) (i, j, k>=0) - Benoit Cloitre (benoit7848c(AT)orange.fr), Jun 14 2004
G.f. A(x) satisfies A(x)= 1+ x+ x^2*A(x)^3 . - Michael Somos Mar 29 2007
Given g.f. A(x), then x*A(-x) is series reversion of A025262(n-1). - Michael Somos Mar 29 2007
|
|
MAPLE
|
A:= proc(n) option remember; if n=0 then 1 else convert (series (1+x+x^2*A(n-1)^3, x=0, n+1), polynom) fi end: a:= n-> coeff (A(n), x, n): seq (a(n), n=0..27); [From Alois P. Heinz (heinz(AT)hs-heilbronn.de), Aug 22 2008]
|
|
PROGRAM
|
(PARI) v=vector(50, j, 1); for(n=3, 50, A=sum(i=1, n, sum(j=1, n, sum(k=1, n, if(i+j+k-n, 0, v[i]*v[j]*v[k])))); v[n]=A); a(n)=v[n+1];
(PARI) {a(n)= local(A); if(n<0, 0, A= 1+O(x); forstep(k= 1, n, 2, A= 1+x+x*x*A^3); polcoeff(A, n))} /* Michael Somos Mar 29 2007 */
(PARI) {a(n)= if(n<0, 0, (-1)^n* polcoeff( serreverse((1-sqrt(1-4*x+4*x^3+x^2*O(x^n)))/2), n+1))} /* Michael Somos Mar 29 2007 */
|
|
CROSSREFS
|
Sequence in context: A096745 A027088 A027102 this_sequence A091488 A007561 A107269
Adjacent sequences: A019494 A019495 A019496 this_sequence A019498 A019499 A019500
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
James Fill (jimfill(AT)jhu.edu)
|
|
EXTENSIONS
|
More terms 07/97 by Olivier Gerard (olivier.gerard(AT)gmail.com)
|
|
|
Search completed in 0.002 seconds
|