// output of ./demo/seq/A178514-demo.cc: // Description: //% OEIS sequence A178514: //% genus of derangements. //% Also A178515: genus of involutions. //% Also A178516: genus of up-down permutations. //% Also A177267: genus of all permutations. //% Also A178517: genus of non-derangement permutations. //% Cf. comb/perm-genus-demo.cc arg 1: 5 == n [Permutations of {1, 2, ..., n}] default=5 arg 2: 4 == c [Condition function: (0: empty), (1: involutions), (2: up-down), (3: indecomposable), (4: derangement), (5: no [x,x+1]) (6: non-derangement)] default=4 Derangements: 1: [ 1 0 3 4 2 ] 0 2: [ 1 0 4 2 3 ] 1 3: [ 1 2 0 4 3 ] 0 4: [ 1 2 3 4 0 ] 0 5: [ 1 2 4 0 3 ] 1 6: [ 1 3 0 4 2 ] 1 7: [ 1 3 4 0 2 ] 1 8: [ 1 3 4 2 0 ] 1 9: [ 1 4 0 2 3 ] 1 10: [ 1 4 3 0 2 ] 1 11: [ 1 4 3 2 0 ] 0 12: [ 2 0 1 4 3 ] 1 13: [ 2 0 3 4 1 ] 1 14: [ 2 0 4 1 3 ] 2 15: [ 2 3 0 4 1 ] 1 16: [ 2 3 1 4 0 ] 1 17: [ 2 3 4 0 1 ] 2 18: [ 2 3 4 1 0 ] 1 19: [ 2 4 0 1 3 ] 1 20: [ 2 4 1 0 3 ] 2 21: [ 2 4 3 0 1 ] 1 22: [ 2 4 3 1 0 ] 1 23: [ 3 0 1 4 2 ] 1 24: [ 3 0 4 1 2 ] 1 25: [ 3 0 4 2 1 ] 2 26: [ 3 2 0 4 1 ] 1 27: [ 3 2 1 4 0 ] 0 28: [ 3 2 4 0 1 ] 1 29: [ 3 2 4 1 0 ] 1 30: [ 3 4 0 1 2 ] 2 31: [ 3 4 0 2 1 ] 1 32: [ 3 4 1 0 2 ] 1 33: [ 3 4 1 2 0 ] 1 34: [ 4 0 1 2 3 ] 2 35: [ 4 0 3 1 2 ] 1 36: [ 4 0 3 2 1 ] 1 37: [ 4 2 0 1 3 ] 1 38: [ 4 2 1 0 3 ] 1 39: [ 4 2 3 0 1 ] 1 40: [ 4 2 3 1 0 ] 0 41: [ 4 3 0 1 2 ] 1 42: [ 4 3 0 2 1 ] 2 43: [ 4 3 1 0 2 ] 2 44: [ 4 3 1 2 0 ] 1 6, 30, 8, 0, 0, ct=44