login
A071656
Permutation of natural numbers induced by the automorphism car_cdr_robl! acting on the parenthesizations encoded by A014486.
9
0, 1, 3, 2, 7, 6, 8, 4, 5, 17, 16, 18, 14, 15, 20, 19, 22, 9, 10, 21, 11, 12, 13, 45, 44, 46, 42, 43, 48, 47, 50, 37, 38, 49, 39, 40, 41, 54, 53, 55, 51, 52, 61, 60, 63, 23, 24, 62, 25, 26, 27, 57, 56, 64, 28, 29, 58, 30, 31, 32, 59, 33, 34, 35, 36, 129, 128, 130, 126, 127
OFFSET
0,3
LINKS
A. Karttunen, Gatomorphisms (Includes the complete Scheme source for computing this sequence)
PROG
(Scheme function implementing this automorphism on list-structures:)
(define (car_cdr_robl! s) (cond ((not (pair? s))) ((not (pair? (cdr s))) (swap! s)) (else (car_cdr_robl! (car s)) (car_cdr_robl! (cdr s)) (robl! s))) s)
(define (robl! s) (let ((ex-car (car s))) (set-car! s (cddr s)) (set-cdr! (cdr s) ex-car) (swap! (cdr s)) (swap! s) s))
(define (swap! s) (let ((ex-car (car s))) (set-car! s (cdr s)) (set-cdr! s ex-car) s))
CROSSREFS
Inverse permutation: A071655. The car/cdr-flipped conjugate of A071659, i.e. A071656(n) = A057163(A071659(A057163(n))). Cf. also A071657, A071658.
Sequence in context: A126851 A082321 A057502 * A130963 A130930 A072095
KEYWORD
nonn
AUTHOR
Antti Karttunen, May 30 2002
STATUS
approved