// output of ./demo/comb/mixedradix-sl-gray-demo.cc: // Description: //% Mixed radix numbers in a minimal-change order //% related so subset-lex order ("SL-Gray" order). //% See Joerg Arndt, Subset-lex: did we miss an order?, (2014) //% http://arxiv.org/abs/1405.6503 arg 1: 3 == n [Number of digits (n>=1)] 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 - [ + + + ] 0 { } 1: [ 1 . . ] 0 + [ + + + ] 0 { a } 2: [ 2 . . ] 0 + [ + + + ] 0 { aa } 3: [ 3 . . ] 0 + [ + + + ] 0 { aaa } 4: [ 3 1 . ] 1 + [ - + + ] 1 { aaab } 5: [ 3 2 . ] 1 + [ - + + ] 1 { aaabb } 6: [ 3 3 . ] 1 + [ - + + ] 1 { aaabbb } 7: [ 3 3 1 ] 2 + [ - - + ] 2 { aaabbbc } 8: [ 3 3 2 ] 2 + [ - - + ] 2 { aaabbbcc } 9: [ 3 3 3 ] 2 + [ - - + ] 2 { aaabbbccc } 10: [ 3 2 3 ] 1 - [ - - - ] 2 { aaabbccc } 11: [ 3 2 2 ] 2 - [ - - - ] 2 { aaabbcc } 12: [ 3 2 1 ] 2 - [ - - - ] 2 { aaabbc } 13: [ 3 1 1 ] 1 - [ - - + ] 2 { aaabc } 14: [ 3 1 2 ] 2 + [ - - + ] 2 { aaabcc } 15: [ 3 1 3 ] 2 + [ - - + ] 2 { aaabccc } 16: [ 3 . 3 ] 1 - [ - - - ] 2 { aaaccc } 17: [ 3 . 2 ] 2 - [ - - - ] 2 { aaacc } 18: [ 3 . 1 ] 2 - [ - - - ] 2 { aaac } 19: [ 2 . 1 ] 0 - [ - + + ] 2 { aac } 20: [ 2 . 2 ] 2 + [ - + + ] 2 { aacc } 21: [ 2 . 3 ] 2 + [ - + + ] 2 { aaccc } 22: [ 2 1 3 ] 1 + [ - + - ] 2 { aabccc } 23: [ 2 1 2 ] 2 - [ - + - ] 2 { aabcc } 24: [ 2 1 1 ] 2 - [ - + - ] 2 { aabc } 25: [ 2 2 1 ] 1 + [ - + + ] 2 { aabbc } 26: [ 2 2 2 ] 2 + [ - + + ] 2 { aabbcc } 27: [ 2 2 3 ] 2 + [ - + + ] 2 { aabbccc } 28: [ 2 3 3 ] 1 + [ - + - ] 2 { aabbbccc } 29: [ 2 3 2 ] 2 - [ - + - ] 2 { aabbbcc } 30: [ 2 3 1 ] 2 - [ - + - ] 2 { aabbbc } 31: [ 2 3 . ] 1 - [ - - + ] 1 { aabbb } 32: [ 2 2 . ] 1 - [ - - + ] 1 { aabb } 33: [ 2 1 . ] 1 - [ - - + ] 1 { aab } 34: [ 1 1 . ] 0 - [ - + + ] 1 { ab } 35: [ 1 2 . ] 1 + [ - + + ] 1 { abb } 36: [ 1 3 . ] 1 + [ - + + ] 1 { abbb } 37: [ 1 3 1 ] 2 + [ - - + ] 2 { abbbc } 38: [ 1 3 2 ] 2 + [ - - + ] 2 { abbbcc } 39: [ 1 3 3 ] 2 + [ - - + ] 2 { abbbccc } 40: [ 1 2 3 ] 1 - [ - - - ] 2 { abbccc } 41: [ 1 2 2 ] 2 - [ - - - ] 2 { abbcc } 42: [ 1 2 1 ] 2 - [ - - - ] 2 { abbc } 43: [ 1 1 1 ] 1 - [ - - + ] 2 { abc } 44: [ 1 1 2 ] 2 + [ - - + ] 2 { abcc } 45: [ 1 1 3 ] 2 + [ - - + ] 2 { abccc } 46: [ 1 . 3 ] 1 - [ - - - ] 2 { accc } 47: [ 1 . 2 ] 2 - [ - - - ] 2 { acc } 48: [ 1 . 1 ] 2 - [ - - - ] 2 { ac } 49: [ . . 1 ] 0 - [ - + + ] 2 { c } 50: [ . . 2 ] 2 + [ - + + ] 2 { cc } 51: [ . . 3 ] 2 + [ - + + ] 2 { ccc } 52: [ . 1 3 ] 1 + [ - + - ] 2 { bccc } 53: [ . 1 2 ] 2 - [ - + - ] 2 { bcc } 54: [ . 1 1 ] 2 - [ - + - ] 2 { bc } 55: [ . 2 1 ] 1 + [ - + + ] 2 { bbc } 56: [ . 2 2 ] 2 + [ - + + ] 2 { bbcc } 57: [ . 2 3 ] 2 + [ - + + ] 2 { bbccc } 58: [ . 3 3 ] 1 + [ - + - ] 2 { bbbccc } 59: [ . 3 2 ] 2 - [ - + - ] 2 { bbbcc } 60: [ . 3 1 ] 2 - [ - + - ] 2 { bbbc } 61: [ . 3 . ] 1 - [ - - + ] 1 { bbb } 62: [ . 2 . ] 1 - [ - - + ] 1 { bb } 63: [ . 1 . ] 1 - [ - - + ] 1 { b } ct=64