login
Self-inverse permutation of natural numbers induced by the function 'reverse' (present in programming languages like Lisp, Scheme, Prolog and Haskell) when it acts on symbolless S-expressions encoded by A014486/A063171.
30

%I #10 Aug 05 2015 17:41:00

%S 0,1,2,3,4,6,5,7,8,9,14,11,16,19,10,15,12,17,18,13,20,21,22,23,37,28,

%T 42,51,25,39,30,44,47,33,53,56,60,24,38,29,43,52,26,40,31,45,46,32,48,

%U 49,50,27,41,34,54,55,35,57,58,59,36,61,62,63,64,65,107,79,121,149,70

%N Self-inverse permutation of natural numbers induced by the function 'reverse' (present in programming languages like Lisp, Scheme, Prolog and Haskell) when it acts on symbolless S-expressions encoded by A014486/A063171.

%H A. Karttunen, <a href="http://www.iki.fi/~kartturi/matikka/Nekomorphisms/gatomorf.htm">Gatomorphisms</a> (Includes the complete Scheme program for computing this sequence)

%H <a href="/index/Li#ListFunsOfLisp">Index entries for the sequences induced by list functions of Lisp</a>

%H <a href="/index/Per#IntegerPermutationCatAuto">Index entries for signature-permutations induced by Catalan automorphisms</a>

%p Similar function for Maple lists can be implemented as: reverse := proc(a) if 0 = nops(a) then (a) else [op(reverse(cdr(a))),a[1]]; fi; end;

%o (Scheme function implementing this automorphism on list-structures:) reverse

%o (Destructive variant, see A057509 for Rol!) (define (Rev1! s) (cond ((pair? s) (Rev1! (cdr s)) (Rol! s))) s)

%o (Another variant, see A057510 for Ror!) (define (Rev2! s) (cond ((pair? s) (Ror! s) (Rev2! (cdr s)))) s)

%Y The car/cdr-flipped conjugate of A069769, i.e. A057508(n) = A057163(A069769(A057163(n))). Cf. also A057164, A057509, A057510, A033538.

%K nonn

%O 0,3

%A _Antti Karttunen_ Sep 03 2000