// output of ./demo/comb/involution-stats-demo.cc: // Description: //% Statistics for involutions (self-inverse permutations): //% Cf. the following OEIS sequences: //% A099174, A161126, A238889, and A239145. arg 1: 5 == n [Permutations of n elements] default=5 arg 2: 0 == sq [Select stats: 0 ==> by maximal descent 1 ==> by maximal ascent 10 ==> by number of ascents 11 ==> by number of descents 20 ==> by maximal displacement 30 ==> by position of last max val 31 ==> by position of last min val ] default=0 1: [ 1 2 3 4 5 ] 0 2: [ 1 2 3 5 4 ] 1 3: [ 1 2 5 4 3 ] 1 4: [ 1 5 3 4 2 ] 2 5: [ 5 2 3 4 1 ] 3 6: [ 1 2 4 3 5 ] 1 7: [ 1 5 4 3 2 ] 1 8: [ 5 2 4 3 1 ] 3 9: [ 1 4 3 2 5 ] 1 10: [ 1 4 5 2 3 ] 3 11: [ 5 4 3 2 1 ] 1 12: [ 4 2 3 1 5 ] 2 13: [ 4 2 5 1 3 ] 4 14: [ 4 5 3 1 2 ] 2 15: [ 1 3 2 4 5 ] 1 16: [ 1 3 2 5 4 ] 1 17: [ 5 3 2 4 1 ] 3 18: [ 4 3 2 1 5 ] 1 19: [ 3 2 1 4 5 ] 1 20: [ 3 2 1 5 4 ] 1 21: [ 3 5 1 4 2 ] 4 22: [ 3 4 1 2 5 ] 3 23: [ 2 1 3 4 5 ] 1 24: [ 2 1 3 5 4 ] 1 25: [ 2 1 5 4 3 ] 1 26: [ 2 1 4 3 5 ] 1 1, 15, 3, 5, 2, 0, ct=26