OFFSET
0,3
COMMENTS
For trees which are already branch-reduced we have a(n)=n, where n is one of A080980.
LINKS
Robert Donaghey, Automorphisms on Catalan trees and bracketing, J. Combin. Theory, Series B, 29 (1980), 75-90.
Antti Karttunen, Gatomorphisms - with the complete Scheme source.
PROG
(Scheme-function implementing this surjection on trees represented as S-expressions:) (define (BranchReducedZigzagTree! bt) (cond ((pair? bt) (cond ((and (pair? (car bt)) (not (null? (caar bt))) (null? (cdar bt))) (set-car! bt (caar bt)) (BranchReducedZigzagTree! bt)) ((and (pair? (cdr bt)) (not (null? (cddr bt))) (null? (cadr bt))) (set-cdr! bt (cddr bt)) (BranchReducedZigzagTree! bt)) (else (BranchReducedZigzagTree! (car bt)) (BranchReducedZigzagTree! (cdr bt)))))) bt)
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Mar 02 2003
STATUS
approved