The triangle begins
\ k 0 1 2 3 4 5 6 7
n -------------------------------------------------------------
1 | 2,
2 | 7, 7, 2,
3 | 45, 219, 243, 5,
4 | 650, 13599, 46385, 4512, 344, 46,
5 | 24520, 2542012, 23807149, 6258387, 781647, 132869, 7134, 714
.
T(2,0) = 7;
matrices that are already stably sorted, i.e., neither affected
by sorting by rows nor by sorting by columns:
[0, 0; 0, 0], [0, 0; 0, 1], [0, 0; 1, 1], [0, 1; 0, 1],
[0, 1; 1, 0], [0, 1; 1, 1], [1, 1; 1, 1]
.
T(2,1) = 7; matrices that become stable after one sort:
sorting by stable
[0, 0; 1, 0] columns -> [0, 0; 0, 1]
[0, 1; 0, 0] rows -> [0, 0; 0, 1]
[1, 0; 0, 1] rows or -> [0, 1; 1, 0]
columns
[1, 0; 1, 0] columns -> [0, 1; 0, 1]
[1, 0; 1, 1] columns -> [0, 1; 1, 1]
[1, 1; 0, 0] rows -> [0, 0; 1, 1]
[1, 1; 0, 1] rows -> [0, 1; 1, 1]
.
T(2,2) = 2; matrices needing two sorts to become stable:
sorting by stable
[1, 0] [0, 1] [0, 0]
[0, 0] [0, 0] [0, 1]
columns -> rows ->
[1, 1] [1, 1] [0, 1]
[1, 0] [0, 1] [1, 1]