// 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 { 0 } 2: [ 2 . . ] 0 + [ + + + ] 0 { 0, 0 } 3: [ 3 . . ] 0 + [ + + + ] 0 { 0, 0, 0 } 4: [ 3 1 . ] 1 + [ - + + ] 1 { 0, 0, 0, 1 } 5: [ 3 2 . ] 1 + [ - + + ] 1 { 0, 0, 0, 1, 1 } 6: [ 3 3 . ] 1 + [ - + + ] 1 { 0, 0, 0, 1, 1, 1 } 7: [ 3 3 1 ] 2 + [ - - + ] 2 { 0, 0, 0, 1, 1, 1, 2 } 8: [ 3 3 2 ] 2 + [ - - + ] 2 { 0, 0, 0, 1, 1, 1, 2, 2 } 9: [ 3 3 3 ] 2 + [ - - + ] 2 { 0, 0, 0, 1, 1, 1, 2, 2, 2 } 10: [ 3 2 3 ] 1 - [ - - - ] 2 { 0, 0, 0, 1, 1, 2, 2, 2 } 11: [ 3 2 2 ] 2 - [ - - - ] 2 { 0, 0, 0, 1, 1, 2, 2 } 12: [ 3 2 1 ] 2 - [ - - - ] 2 { 0, 0, 0, 1, 1, 2 } 13: [ 3 1 1 ] 1 - [ - - + ] 2 { 0, 0, 0, 1, 2 } 14: [ 3 1 2 ] 2 + [ - - + ] 2 { 0, 0, 0, 1, 2, 2 } 15: [ 3 1 3 ] 2 + [ - - + ] 2 { 0, 0, 0, 1, 2, 2, 2 } 16: [ 3 . 3 ] 1 - [ - - - ] 2 { 0, 0, 0, 2, 2, 2 } 17: [ 3 . 2 ] 2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