%I #28 Feb 12 2024 08:40:14
%S 0,0,1,0,2,3,5,4,1,0,6,8,9,15,14,12,2,3,13,16,17,23,22,19,5,4,18,20,
%T 21,11,10,7,1,0,24,30,32,33,57,56,54,48,6,8,50,60,62,63,65,64,61,51,9,
%U 15,75,85,88,89,87,86,84,74,14,12,72,78,80,81
%N Irregular triangle read by rows: T(m, n) is the n-th permutation of m things generated by the Steinhaus-Johnson-Trotter algorithm, represented by row number of A055089.
%C Row m is a permutation of the integers 0..m!-1, so this is a triangle in which row m>=1 has length A000142(m).
%C Compare A280318 for Heap's algorithm, which is one infinite permutation rather than a triangle of finite permutations.
%H Tilman Piesk, <a href="/A280319/b280319.txt">Triangle rows m=1..7, flattened</a>
%H Tilman Piesk, <a href="http://pastebin.com/ZfdQJ5fA">Calculation with Python</a>
%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Steinhaus%E2%80%93Johnson%E2%80%93Trotter_algorithm">Steinhaus-Johnson-Trotter algorithm</a>
%e Triangle begins:
%e m/n 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
%e 1 0
%e 2 0 1
%e 3 0 2 3 5 4 1
%e 4 0 6 8 9 15 14 12 2 3 13 16 17 23 22 19 5 4 18 20 21 11 10 7 1
%e Example for row m=4. On the right are the permutations of {1,2,3,4} in the order generated by the Steinhaus-Johnson-Trotter algorithm (A207324):
%e n rev colex T(4,n) SJT
%e 0 1 2 3 4 0 1 2 3 4
%e 1 2 1 3 4 6 1 2 4 3
%e 2 1 3 2 4 8 1 4 2 3
%e 3 3 1 2 4 9 4 1 2 3
%e 4 2 3 1 4 15 4 1 3 2
%e 5 3 2 1 4 14 1 4 3 2
%e 6 1 2 4 3 12 1 3 4 2
%e 7 2 1 4 3 2 1 3 2 4
%e 8 1 4 2 3 3 3 1 2 4
%e 9 4 1 2 3 13 3 1 4 2
%e 10 2 4 1 3 16 3 4 1 2
%e 11 4 2 1 3 17 4 3 1 2
%e 12 1 3 4 2 23 4 3 2 1
%e 13 3 1 4 2 22 3 4 2 1
%e 14 1 4 3 2 19 3 2 4 1
%e 15 4 1 3 2 5 3 2 1 4
%e 16 3 4 1 2 4 2 3 1 4
%e 17 4 3 1 2 18 2 3 4 1
%e 18 2 3 4 1 20 2 4 3 1
%e 19 3 2 4 1 21 4 2 3 1
%e 20 2 4 3 1 11 4 2 1 3
%e 21 4 2 3 1 10 2 4 1 3
%e 22 3 4 2 1 7 2 1 4 3
%e 23 4 3 2 1 1 2 1 3 4
%Y Cf. A000142, A055089, A207324, A280318.
%K nonn,tabf
%O 0,5
%A _Tilman Piesk_, Dec 31 2016