%I #7 Oct 17 2015 08:36:23
%S 0,1,0,3,1,0,2,2,1,0,7,3,3,1,0,8,4,2,3,1,0,6,6,8,2,3,1,0,4,5,7,7,2,3,
%T 1,0,5,7,6,6,8,2,3,1,0,17,8,5,8,7,7,2,2,1,0,18,9,4,4,6,8,7,3,3,1,0,20,
%U 10,22,5,5,5,8,4,2,2,1,0,21,14,21,17,4,4,6,5,8,3,3,1,0
%N Number of simple Catalan bijections of type B.
%C Each row is a permutation of nonnegative integers induced by a Catalan bijection (constructed as explained below) acting on the parenthesizations/plane binary trees as encoded and ordered by A014486/A063171.
%C The construction process is akin to the constructive mapping of primitive recursive functions to N: we have two basic primitives, A069770 (row 0) and A072796 (row 1), of which the former swaps the left and the right subtree of a binary tree and the latter exchanges the positions of the two leftmost subtrees of plane general trees, unless the tree's degree is less than 2, in which case it just fixes it. From then on, the even rows are constructed recursively from any other Catalan bijection in this table, using one of the five allowed recursion types:
%C 0 - Apply the given Catalan bijection and then recurse down to both subtrees of the new binary tree obtained. (last decimal digit of row number = 2)
%C 1 - First recurse down to both subtrees of the old binary tree and only after that apply the given Catalan bijection. (last digit = 4)
%C 2 - Apply the given Catalan bijection and then recurse down to the right subtree of the new binary tree obtained. (last digit = 6)
%C 3 - First recurse down to the right subtree of old binary tree and only after that apply the given Catalan bijection. (last digit = 8)
%C 4 - First recurse down to the left subtree of old binary tree, after that apply the given Catalan bijection and then recurse down to the right subtree of the new binary tree. (last digit = 0)
%C The odd rows > 2 are compositions of the rows 0, 1, 2, 4, 6, 8, ... (i.e. either one of the primitives A069770 or A072796, or one of the recursive compositions) at the left hand side and any Catalan bijection from the same array at the right hand side. See the scheme-functions index-for-recursive-sgtb and index-for-composed-sgtb how to compute the positions of the recursive and ordinary compositions in this table.
%H A. Karttunen, <a href="http://www.iki.fi/~kartturi/matikka/Nekomorphisms/gatomorf.htm">Gatomorphisms</a> (With the complete source and explanation)
%o (Scheme functions showing how to compute the row where either the recursive composition of foo (with rectype 0-4) or an ordinary composition of lhs and rhs occur in this table, where foo, lhs and rhs are also indices to this table):
%o (define (index-for-recursive-sgtb foo rectype) (+ 2 (* 10 foo) (* 2 rectype)))
%o (define (index-for-composed-sgtb lhs rhs) (let ((new-lhs (cond ((< lhs 2) lhs) ((even? lhs) (1+ (/ lhs 2))) (else (error "Only the primitive Catalan bijections A069770 (0) & A072796 (1) or one of the recursively composed Catalan bijections (even numbers >= 2) can occur at the left side of the composition. Odd number not allowed: " lhs))))) (1+ (packA054238 (* 2 new-lhs) rhs))))
%o (define (packA054238 x y) (+ (A000695 x) (* 2 (A000695 y))))
%o (define (A000695 n) (if (zero? n) n (+ (modulo n 2) (* 4 (A000695 (floor->exact (/ n 2)))))))
%Y Four other tables giving the corresponding cycle-counts: A073201, counts of the fixed elements: A073202, the lengths of the largest cycles: A073203, the LCM's of all the cycles: A073204. The ordinary compositions are encoded using the N X N -> N bijection A054238 (which in turn uses the bit-interleaving function A000695).
%Y The first 21 rows of this table:.
%Y Row 0: A069770. Row 1: A072796. Row 2: A057163. Row 3: A073269, Row 4: A057163 (duplicate), Row 5: A073270, Row 6: A069767, Row 7: A001477 (identity perm.), Row 8: A069768, Row 9: A073280.
%Y Row 10: A069770 (dupl.), Row 11: A072796 (dupl.), Row 12: A057511, Row 13: A073282, Row 14: A057512, Row 15: A073281, Row 16: A057509, Row 17: A073280 (dupl.), Row 18: A057510, Row 19: A073283, Row 20: A073284.
%Y Other Catalan bijection-induced EIS-permutations which occur in this table. Only the first known occurrence is given. Involutions are marked with *, others paired with their inverse:.
%Y Row 164: A057164*, Row 168: A057508*, Row 179: A072797*.
%Y Row 41: A073286 - Row 69: A073287. Row 105: A073290 - Row 197: A073291. Row 416: A073288 - Row 696: A073289.
%Y Row 261: A057501 - Row 521: A057502. Row 2618: A057503 - Row 5216: A057504. Row 2614: A057505 - Row 5212: A057506.
%Y Row 10435: A073292 - Row ...: A073293. Row 17517: A057161 - Row ...: A057162.
%Y For a more practical enumeration system of (some) Catalan automorphisms see table A089840 and its various "recursive derivations".
%K nonn,tabl
%O 0,4
%A _Antti Karttunen_, Jun 25 2002