// output of ./demo/comb/mixedradix-prefix-cond-demo.cc: // Description: //% Mixed radix counting with restricted prefixes. arg 1: 4 == n [Number of digits] default=4 arg 2: 1 == rr [Base (radix) of digits (0==>falling factorial, 1==>rising factorial)] default=1 arg 3: 4 == c [Condition function: 0 ==> all words (condition always true), 1 ==> no two adjacent nonzero digits, 2 ==> adjacent digits distinct 3 ==> sorted (weakly ascending) digits 4 ==> smooth: adjacent digits have absolute difference <= 1 5 ==> adjacent digits have different parities] default=4 1: [ . . . . ] 0 2: [ . . . 1 ] 3 3: [ . . 1 . ] 2 4: [ . . 1 1 ] 3 5: [ . . 1 2 ] 3 6: [ . 1 . . ] 1 7: [ . 1 . 1 ] 3 8: [ . 1 1 . ] 2 9: [ . 1 1 1 ] 3 10: [ . 1 1 2 ] 3 11: [ . 1 2 1 ] 2 12: [ . 1 2 2 ] 3 13: [ . 1 2 3 ] 3 14: [ 1 . . . ] 0 15: [ 1 . . 1 ] 3 16: [ 1 . 1 . ] 2 17: [ 1 . 1 1 ] 3 18: [ 1 . 1 2 ] 3 19: [ 1 1 . . ] 1 20: [ 1 1 . 1 ] 3 21: [ 1 1 1 . ] 2 22: [ 1 1 1 1 ] 3 23: [ 1 1 1 2 ] 3 24: [ 1 1 2 1 ] 2 25: [ 1 1 2 2 ] 3 26: [ 1 1 2 3 ] 3 27: [ 1 2 1 . ] 1 28: [ 1 2 1 1 ] 3 29: [ 1 2 1 2 ] 3 30: [ 1 2 2 1 ] 2 31: [ 1 2 2 2 ] 3 32: [ 1 2 2 3 ] 3 33: [ 1 2 3 2 ] 2 34: [ 1 2 3 3 ] 3 35: [ 1 2 3 4 ] 3 ct=35