

A072797


Selfinverse permutation of natural numbers induced by Catalan Automorphism *A072797 acting on the parenthesizations encoded by A014486.


33



0, 1, 2, 3, 4, 5, 7, 6, 8, 9, 10, 11, 12, 13, 17, 18, 16, 14, 15, 20, 19, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 45, 46, 48, 49, 50, 44, 47, 42, 37, 38, 43, 39, 40, 41, 54, 55, 53, 51, 52, 57, 56, 58, 59, 61, 60, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

0,3


COMMENTS

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).
.A...B...........A...C
..\./.............\./
...x...C....>....x...B...............()..A........()...A..
....\./.............\./.................\./....>....\./...
.....x...............x...................x.............x....
((a . b) . c) > ((a . c) . b) ____ (() . a) > (() . a)
In terms of Sexpressions, this automorphism swaps cdar and cdr of an Sexp if its carelement is not ().
See the Karttunen OEISWiki link for a detailed explanation of how to obtain a given integer sequence from this definition.


LINKS

Table of n, a(n) for n=0..71.
A. Karttunen, Catalan Automorphisms
Index entries for signaturepermutations induced by Catalan automorphisms


PROG

(Scheme function implementing this automorphism on liststructures/Sexpressions, both constructive (*A072797) and destructive (*A072797!) version:)(define (*A072797 s) (if (and (pair? s) (pair? (car s))) (cons (cons (caar s) (cdr s)) (cdar s)) s))
(define (*A072797! s) (cond ((not (pair? s)) s) ((not (pair? (car s))) s) (else (swap! s) (robl! s) (swap! (car s)) s)))
(define (robl! s) (let ((excar (car s))) (setcar! s (cddr s)) (setcdr! (cdr s) excar) (swap! (cdr s)) (swap! s) s))
(define (swap! s) (let ((excar (car s))) (setcar! s (cdr s)) (setcdr! s excar) s))


CROSSREFS

Row 8 of A089840. A left/rightflipped conjugate of A072796, i.e. A072797(n) = A057163(A072796(A057163(n))). Counts for fixed points and counts for distinct cycles (in each range limited by A014137 and A014138) are given in A073190 and A073191.
Sequence in context: A131424 A222249 A230565 * A131169 A131170 A082338
Adjacent sequences: A072794 A072795 A072796 * A072798 A072799 A072800


KEYWORD

nonn


AUTHOR

Antti Karttunen, Jun 12 2002


EXTENSIONS

Further comments and constructive implementation of Schemefunction (*A072797) added by Antti Karttunen, Jun 04 2011


STATUS

approved



