%I
%S 0,1,3,2,7,8,4,5,6,17,18,20,21,22,9,10,11,12,13,14,15,16,19,45,46,48,
%T 49,50,54,55,57,58,59,61,62,63,64,23,24,25,26,27,28,29,30,31,32,33,34,
%U 35,36,37,38,39,40,41,42,43,44,47,51,52,53,56,60,129,130,132,133,134
%N Signature permutation of the seventeenth nonrecursive Catalan automorphism in table A089840. (Rotate binary tree right if possible, otherwise swap its sides.)
%C This automorphism effects the following transformation on the unlabeled rooted plane binary trees (letters A, B, C refer to arbitrary subtrees located on those nodes and () stands for an implied terminal node.)
%C A...B..............B...C
%C .\./................\./
%C ..x...C..>.....A...x................()..B.......B..()
%C ...\./............\./..................\./...>...\./.
%C ....x..............x....................x...........x..
%C ((a . b) . c) > (a . (b . c)) ____ (() . b) > (b . ())
%C That is, we rotate the binary tree right, in case it is possible and otherwise (if the left hand side of a tree is a terminal node) swap the right and left subtree (so that the terminal node ends to the right hand side), i.e. apply the automorphism *A069770. Look at the example in A069770 to see how this will produce the given sequence of integers.
%C See also the comments at A074679.
%D A. Karttunen, paper in preparation, draft available by email.
%H A. Karttunen, <a href="/A074680/b074680.txt">Table of n, a(n) for n = 0..2055</a>
%H A. Karttunen, <a href="/A089840/a089840p.txt">Prologprogram which illustrates the construction of this and similar nonrecursive Catalan automorphisms.</a>
%H <a href="/index/Per#IntegerPermutationCatAuto">Index entries for signaturepermutations of Catalan automorphisms</a>
%o (Scheme implementations of this automorphism. These act on Sexpressions, i.e. liststructures:)
%o (CONSTRUCTIVE VERSION:) (define (*A074680 s) (cond ((not (pair? s)) s) ((pair? (car s)) (cons (caar s) (cons (cdar s) (cdr s)))) (else (cons (cdr s) (car s)))))
%o (DESTRUCTIVE VERSION:) (define (*A074680! s) (cond ((pair? s) (cond ((pair? (car s)) (robr! s)) (else (swap! s))))) s)
%o (define (robr! s) (let ((excdr (cdr s))) (setcdr! s (caar s)) (setcar! (car s) excdr) (swap! (car s)) (swap! s) s))
%o (define (swap! s) (let ((excar (car s))) (setcar! s (cdr s)) (setcdr! s excar) s))
%Y This automorphism has several variants, where the first clause is same (rotate binary tree to the right, if possible), but something else is done (than just swapping sides), in case the left hand side is empty: A082336, A082350, A123500, A123696. The following automorphisms can be derived recursively from this one: A057501, A074682, A074684, A074686, A074688, A074689, A089866, A120705, A122322, A122331. See also somewhat similar ones: A069774, A071659, A071655, A071657, A072090, A072094, A072092.
%Y Inverse: A074679. Row 17 of A089840. Occurs also in A073200 as row 2156396687 as a(n) = A072796(A073280(A073282(n))). a(n) = A083927(A123497(A057123(n))).
%Y Number of cycles: LEFT(A001683). Number of fixed points: LEFT(A019590). Max. cycle size & LCM of all cycle sizes: A089410 (in range [A014137(n1)..A014138(n1)] of this permutation).
%K nonn
%O 0,3
%A _Antti Karttunen_, Sep 11 2002, description clarified Oct 10 2006.
