// output of ./demo/comb/composition-nz-upstep-demo.cc: // Description: //% Compositions of n into positive parts, with limit on up-step. //% Lexicographic order. //% Cf. OEIS sequences A003116 (max up-step 1) //% and A224959 (max up-step 2). //% Max up-step 0 gives partitions as weakly descending lists. arg 1: 7 == n [compositions of n] default=7 arg 2: 1 == u [maximal up-step] default=1 arg 3: 0 == aa [whether to render as ASCII art] default=0 0: [ 7] [ 1 1 1 1 1 1 1 ] 1: [ 6] [ 1 1 1 1 1 2 ] 2: [ 6] [ 1 1 1 1 2 1 ] 3: [ 6] [ 1 1 1 2 1 1 ] 4: [ 5] [ 1 1 1 2 2 ] 5: [ 6] [ 1 1 2 1 1 1 ] 6: [ 5] [ 1 1 2 1 2 ] 7: [ 5] [ 1 1 2 2 1 ] 8: [ 4] [ 1 1 2 3 ] 9: [ 6] [ 1 2 1 1 1 1 ] 10: [ 5] [ 1 2 1 1 2 ] 11: [ 5] [ 1 2 1 2 1 ] 12: [ 5] [ 1 2 2 1 1 ] 13: [ 4] [ 1 2 2 2 ] 14: [ 4] [ 1 2 3 1 ] 15: [ 6] [ 2 1 1 1 1 1 ] 16: [ 5] [ 2 1 1 1 2 ] 17: [ 5] [ 2 1 1 2 1 ] 18: [ 5] [ 2 1 2 1 1 ] 19: [ 4] [ 2 1 2 2 ] 20: [ 5] [ 2 2 1 1 1 ] 21: [ 4] [ 2 2 1 2 ] 22: [ 4] [ 2 2 2 1 ] 23: [ 3] [ 2 2 3 ] 24: [ 4] [ 2 3 1 1 ] 25: [ 3] [ 2 3 2 ] 26: [ 5] [ 3 1 1 1 1 ] 27: [ 4] [ 3 1 1 2 ] 28: [ 4] [ 3 1 2 1 ] 29: [ 4] [ 3 2 1 1 ] 30: [ 3] [ 3 2 2 ] 31: [ 3] [ 3 3 1 ] 32: [ 2] [ 3 4 ] 33: [ 4] [ 4 1 1 1 ] 34: [ 3] [ 4 1 2 ] 35: [ 3] [ 4 2 1 ] 36: [ 2] [ 4 3 ] 37: [ 3] [ 5 1 1 ] 38: [ 2] [ 5 2 ] 39: [ 2] [ 6 1 ] 40: [ 1] [ 7 ] ct=41