OFFSET
1,2
EXAMPLE
Triangle of Lyndon compositions begins:
(1),
(2),
(12),(3),
(112),(13),(4),
(1112),(113),(122),(14),(23),(5),
(11112),(1113),(1122),(114),(123),(132),(15),(24),(6),
(111112),(11113),(11122),(1114),(11212),(1123),(1132),(115),(1213),(1222),(124),(133),(142),(16),(223),(25),(34),(7).
MATHEMATICA
LyndonQ[q_]:=Array[OrderedQ[{q, RotateRight[q, #]}]&, Length[q]-1, 1, And]&&Array[RotateRight[q, #]&, Length[q], 1, UnsameQ];
Table[Sort[Select[Join@@Permutations/@IntegerPartitions[n], LyndonQ], OrderedQ[PadRight[{#1, #2}]]&], {n, 7}]
CROSSREFS
KEYWORD
nonn,tabf
AUTHOR
Gus Wiseman, Dec 18 2017
STATUS
approved