OFFSET
0,3
COMMENTS
Note: the leaf positions are indexed so that the rightmost one in the tree is leaf 0, etc., up to the leftmost one, which is the leaf with index A072643(x). In this manner, terms on each row stay in monotone order. Row n (starting from row 0) contains A072643(n)+1 nonzero terms and then an infinite number of zeros after that. A153249 gives only the nonzero terms. Can be used to compute "fleeing tree" sequences for Catalan bijections. See comments at A153246.
LINKS
A. Karttunen, Table of n, a(n) for n = 0..1274
EXAMPLE
Top left corner of array:
1, 0, 0, 0, 0, ...
2, 3, 0, 0, 0, ...
4, 5, 6, 0, 0, ...
6, 7, 8, 0, 0, ...
9, 10, 11, 14, 0, ...
11, 12, 13, 15, 0, ...
14, 15, 16, 19, 0, ...
By inserting a bud (\/) at leaf position 1 of binary tree A014486(2) (leaf positions numbered for clarification):
....1....0
.....\../
..2...\/
...\../
....\/
we obtain a binary tree:
.......
.\../..
..\/...
...\../
....\/
.\../
..\/
which is the 5th binary tree encoded by A014486. Thus A(2,1)=5.
PROG
(MIT Scheme:)
(define (A153250bi x y) (A080300 (parenthesization->a014486 (bud! (A014486->parenthesization (A014486 x)) y))))
(define (bud! s i) (replace-n-th-leaf! s i (list (list))))
(define (replace-n-th-leaf! s i scion) (cond ((> i (count-pars s)) (quote ())) ((null? s) scion) (else (let ((leafs-to-visit i)) (call-with-current-continuation (lambda (exit) (let fork ((s s)) (cond ((null? (cdr s)) (if (zero? leafs-to-visit) (exit (set-cdr! s scion)) (set! leafs-to-visit (-1+ leafs-to-visit)))) (else (fork (cdr s)))) (cond ((null? (car s)) (if (zero? leafs-to-visit) (exit (set-car! s scion)) (set! leafs-to-visit (-1+ leafs-to-visit)))) (else (fork (car s))))))) s))))
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Antti Karttunen, Dec 22 2008
STATUS
approved