// output of ./demo/comb/mixedradix-gray-demo.cc: // Description: //% Mixed radix Gray code, CAT algorithm. arg 1: 3 == n [Number of digits] default=3 arg 2: 4 == rr [Base (radix) of digits (0==>falling factorial, 1==>rising factorial)] default=4 args 3,4,... : [Optionally supply radix for all digits (rr ignored)] Nines: [ 3 3 3 ] 0: [ . . . ] 0 3 +1 1: [ 1 . . ] 1 0 +1 2: [ 2 . . ] 2 0 +1 3: [ 3 . . ] 3 0 +1 4: [ 3 1 . ] 7 1 +1 5: [ 2 1 . ] 6 0 -1 6: [ 1 1 . ] 5 0 -1 7: [ . 1 . ] 4 0 -1 8: [ . 2 . ] 8 1 +1 9: [ 1 2 . ] 9 0 +1 10: [ 2 2 . ] 10 0 +1 11: [ 3 2 . ] 11 0 +1 12: [ 3 3 . ] 15 1 +1 13: [ 2 3 . ] 14 0 -1 14: [ 1 3 . ] 13 0 -1 15: [ . 3 . ] 12 0 -1 16: [ . 3 1 ] 28 2 +1 17: [ 1 3 1 ] 29 0 +1 18: [ 2 3 1 ] 30 0 +1 19: [ 3 3 1 ] 31 0 +1 20: [ 3 2 1 ] 27 1 -1 21: [ 2 2 1 ] 26 0 -1 22: [ 1 2 1 ] 25 0 -1 23: [ . 2 1 ] 24 0 -1 24: [ . 1 1 ] 20 1 -1 25: [ 1 1 1 ] 21 0 +1 26: [ 2 1 1 ] 22 0 +1 27: [ 3 1 1 ] 23 0 +1 28: [ 3 . 1 ] 19 1 -1 29: [ 2 . 1 ] 18 0 -1 30: [ 1 . 1 ] 17 0 -1 31: [ . . 1 ] 16 0 -1 32: [ . . 2 ] 32 2 +1 33: [ 1 . 2 ] 33 0 +1 34: [ 2 . 2 ] 34 0 +1 35: [ 3 . 2 ] 35 0 +1 36: [ 3 1 2 ] 39 1 +1 37: [ 2 1 2 ] 38 0 -1 38: [ 1 1 2 ] 37 0 -1 39: [ . 1 2 ] 36 0 -1 40: [ . 2 2 ] 40 1 +1 41: [ 1 2 2 ] 41 0 +1 42: [ 2 2 2 ]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