login
Each tree encoded in A014486 mapped to the corresponding branch-reduced zigzag-tree (positions in A014486).
4

%I #11 Jan 11 2024 03:04:29

%S 0,1,2,3,2,5,6,7,3,2,5,11,12,5,6,15,16,7,18,6,20,7,3,2,5,11,12,5,11,

%T 29,30,12,32,11,34,12,5,6,15,39,40,15,16,43,16,7,18,47,48,49,18,6,15,

%U 53,20,55,16,57,7,18,6,20,20,7,3,2,5,11,12,5,11,29,30,12,32,11,34,12,5,11,29

%N Each tree encoded in A014486 mapped to the corresponding branch-reduced zigzag-tree (positions in A014486).

%C For trees which are already branch-reduced we have a(n)=n, where n is one of A080980.

%H Robert Donaghey, <a href="https://doi.org/10.1016/0095-8956(80)90045-3">Automorphisms on Catalan trees and bracketing</a>, J. Combin. Theory, Series B, 29 (1980), 75-90.

%H Antti Karttunen, <a href="http://www.iki.fi/~kartturi/matikka/Nekomorphisms/gatomorf.htm">Gatomorphisms - with the complete Scheme source</a>.

%o (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)

%Y Same sequence sorted, with duplicates removed: A080980. Cf. A080293.

%K nonn

%O 0,3

%A _Antti Karttunen_, Mar 02 2003