login
A153250
Array A(x,y): A(0,0), A(1,0), A(0,1), A(2,0), A(1,1), A(0,2), ... formed by growing a bud (a single V-node) on the y-th leaf of the binary tree A014486(x).
4
1, 0, 2, 0, 3, 4, 0, 0, 5, 6, 0, 0, 6, 7, 9, 0, 0, 0, 8, 10, 11, 0, 0, 0, 0, 11, 12, 14, 0, 0, 0, 0, 14, 13, 15, 16, 0, 0, 0, 0, 0, 15, 16, 17, 19, 0, 0, 0, 0, 0, 0, 19, 18, 20, 23, 0, 0, 0, 0, 0, 0, 0, 20, 21, 24, 25, 0, 0, 0, 0, 0, 0, 0, 0, 22, 25, 26, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 27, 29, 30
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
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 (A153250 n) (A153250bi (A002262 n) (A025581 n)))
(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
Sequence in context: A370724 A321527 A224226 * A102389 A099091 A227595
KEYWORD
nonn,tabl
AUTHOR
Antti Karttunen, Dec 22 2008
STATUS
approved