OFFSET
0,3
COMMENTS
This automorphism rotates by 180 degrees the interpretation n (the non-crossing handshakes) of Stanley's exercise 19.
LINKS
A. Karttunen, Gatomorphisms (Includes the complete Scheme program for computing this sequence)
R. P. Stanley, Exercises on Catalan and Related Numbers
PROG
(Scheme function implementing this automorphism on list-structures:) (define (RotateHandshakes180 a) (RotateHandshakes_n_steps a (count-pars a)))
(define (count-pars a) (if (not (pair? a)) 0 (+ 1 (count-pars (car a)) (count-pars (cdr a)))))
(define (RotateHandshakes a) (if (null? a) (list) (append (car a) (list (cdr a)))))
(define (RotateHandshakes_n_steps a n) (if (zero? n) a (RotateHandshakes_n_steps (RotateHandshakes a) (-1+ n))))
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Apr 16 2002
STATUS
approved