// output of ./demo/comb/necklace-fkm-demo.cc: // Description: //% Fredericksen, Kessler, Maiorana (FKM) algorithm for generating necklaces. arg 1: 7 == n [Length of necklaces (n>=1)] default=7 arg 2: 2 == k [Number of different beads (k>=2)] default=2 1: [ . . . . . . . ] j=1 N 2: [ . . . . . . 1 ] j=7 N L 3: [ . . . . . 1 . ] j=6 4: [ . . . . . 1 1 ] j=7 N L 5: [ . . . . 1 . . ] j=5 6: [ . . . . 1 . 1 ] j=7 N L 7: [ . . . . 1 1 . ] j=6 8: [ . . . . 1 1 1 ] j=7 N L 9: [ . . . 1 . . . ] j=4 10: [ . . . 1 . . 1 ] j=7 N L 11: [ . . . 1 . 1 . ] j=6 12: [ . . . 1 . 1 1 ] j=7 N L 13: [ . . . 1 1 . . ] j=5 14: [ . . . 1 1 . 1 ] j=7 N L 15: [ . . . 1 1 1 . ] j=6 16: [ . . . 1 1 1 1 ] j=7 N L 17: [ . . 1 . . 1 . ] j=3 18: [ . . 1 . . 1 1 ] j=7 N L 19: [ . . 1 . 1 . . ] j=5 20: [ . . 1 . 1 . 1 ] j=7 N L 21: [ . . 1 . 1 1 . ] j=6 22: [ . . 1 . 1 1 1 ] j=7 N L 23: [ . . 1 1 . . 1 ] j=4 24: [ . . 1 1 . 1 . ] j=6 25: [ . . 1 1 . 1 1 ] j=7 N L 26: [ . . 1 1 1 . . ] j=5 27: [ . . 1 1 1 . 1 ] j=7 N L 28: [ . . 1 1 1 1 . ] j=6 29: [ . . 1 1 1 1 1 ] j=7 N L 30: [ . 1 . 1 . 1 . ] j=2 31: [ . 1 . 1 . 1 1 ] j=7 N L 32: [ . 1 . 1 1 . 1 ] j=5 33: [ . 1 . 1 1 1 . ] j=6 34: [ . 1 . 1 1 1 1 ] j=7 N L 35: [ . 1 1 . 1 1 . ] j=3 36: [ . 1 1 . 1 1 1 ] j=7 N L 37: [ . 1 1 1 . 1 1 ] j=4 38: [ . 1 1 1 1 . 1 ] j=5 39: [ . 1 1 1 1 1 . ] j=6 40: [ . 1 1 1 1 1 1 ] j=7 N L 41: [ 1 1 1 1 1 1 1 ] j=1 N 41 (7, 2) pre-necklaces. 20 necklaces and 18 Lyndon words.