A329394 Number of compositions of n whose Lyndon and co-Lyndon factorizations both have the same length.
1, 2, 2, 4, 4, 10, 13, 28, 46, 99, 175, 359, 672, 1358, 2627, 5238, 10262, 20438, 40320, 80137
Offset: 1
Examples
The a(1) = 1 through a(7) = 13 compositions: (1) (2) (3) (4) (5) (6) (7) (11) (111) (22) (131) (33) (151) (121) (212) (141) (214) (1111) (11111) (213) (232) (222) (241) (231) (313) (1221) (1312) (2112) (1321) (11211) (2113) (111111) (11311) (12121) (21112) (1111111)
Crossrefs
Programs
-
Mathematica
lynQ[q_]:=Array[Union[{q,RotateRight[q,#]}]=={q,RotateRight[q,#]}&,Length[q]-1,1,And]; lynfac[q_]:=If[Length[q]==0,{},Function[i,Prepend[lynfac[Drop[q,i]],Take[q,i]]][Last[Select[Range[Length[q]],lynQ[Take[q,#]]&]]]]; colynQ[q_]:=Array[Union[{RotateRight[q,#],q}]=={RotateRight[q,#],q}&,Length[q]-1,1,And]; colynfac[q_]:=If[Length[q]==0,{},Function[i,Prepend[colynfac[Drop[q,i]],Take[q,i]]]@Last[Select[Range[Length[q]],colynQ[Take[q,#]]&]]]; Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],Length[lynfac[#]]==Length[colynfac[#]]&]],{n,10}]
Comments