// output of ./demo/comb/necklace-demo.cc:
// Description:
//% Generate all pre-necklaces, necklaces, and Lyndon words with a given number of colors.

arg 1: 4 == n  [length of strings >=1]  default=4
arg 2: 3 == m  [number of different beads >=2]  default=3
    ....   1       .  N
    ...1   4    ...1  N L
    ...2   4    ...2  N L
    ..1.   3     .1.
    ..11   4    ..11  N L
    ..12   4    ..12  N L
    ..2.   3     .2.
    ..21   4    ..21  N L
    ..22   4    ..22  N L
    .1.1   2      .1  N
    .1.2   4    .1.2  N L
    .11.   3     11.
    .111   4    .111  N L
    .112   4    .112  N L
    .12.   3     12.
    .121   4    .121  N L
    .122   4    .122  N L
    .2.2   2      .2  N
    .21.   3     21.
    .211   4    .211  N L
    .212   4    .212  N L
    .22.   3     22.
    .221   4    .221  N L
    .222   4    .222  N L
    1111   1       1  N
    1112   4    1112  N L
    1121   3     121
    1122   4    1122  N L
    1212   2      12  N
    1221   3     221
    1222   4    1222  N L
    2222   1       2  N
  # pre-necklaces = 32  # necklaces = 24  # Lyndon words = 18
