OFFSET
0,3
COMMENTS
LINKS
PROG
(Scheme functions below show the essential idea. For a complete source, see the "Alternative Catalan Orderings" OEIS Wiki page.)
(define lexrank->arithrankA001477 (lexrank->arithrank-bijection packA001477))
(define (lexrank->arithrank-bijection packfun) (lambda (n) (rank-bintree (binexp->parenthesization (A014486 n)) packfun)))
(define (rank-bintree bt packfun) (cond ((not (pair? bt)) 0) (else (1+ (packfun (rank-bintree (car bt) packfun) (rank-bintree (cdr bt) packfun))))))
(define (packA001477 x y) (/ (+ (expt (+ x y) 2) x (* 3 y)) 2))
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, May 30 2002
STATUS
approved