A329398 Number of compositions of n with uniform Lyndon factorization and uniform co-Lyndon factorization.
1, 2, 4, 7, 12, 18, 28, 40, 57, 80, 110, 148, 200, 266, 348, 457, 592, 764, 978, 1248, 1580, 2000, 2508, 3142, 3913
Offset: 1
Examples
The a(1) = 1 through a(6) = 18 compositions: (1) (2) (3) (4) (5) (6) (11) (12) (13) (14) (15) (21) (22) (23) (24) (111) (31) (32) (33) (112) (41) (42) (211) (113) (51) (1111) (122) (114) (221) (123) (311) (222) (1112) (321) (2111) (411) (11111) (1113) (1122) (2211) (3111) (11112) (21111) (111111)
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],SameQ@@Length/@lynfac[#]&&SameQ@@Length/@colynfac[#]&]],{n,10}]
Extensions
a(19)-a(25) from Robert Price, Jun 20 2021
Comments