login
Number of compositions of n with uniform Lyndon factorization and uniform co-Lyndon factorization.
34

%I #15 Jun 20 2021 11:07:37

%S 1,2,4,7,12,18,28,40,57,80,110,148,200,266,348,457,592,764,978,1248,

%T 1580,2000,2508,3142,3913

%N Number of compositions of n with uniform Lyndon factorization and uniform co-Lyndon factorization.

%C We define the Lyndon product of two or more finite sequences to be the lexicographically maximal sequence obtainable by shuffling the sequences together. For example, the Lyndon product of (231) with (213) is (232131), the product of (221) with (213) is (222131), and the product of (122) with (2121) is (2122121). A Lyndon word is a finite sequence that is prime with respect to the Lyndon product. Equivalently, a Lyndon word is a finite sequence that is lexicographically strictly less than all of its cyclic rotations. Every finite sequence has a unique (orderless) factorization into Lyndon words, and if these factors are arranged in lexicographically decreasing order, their concatenation is equal to their Lyndon product. For example, (1001) has sorted Lyndon factorization (001)(1).

%C Similarly, the co-Lyndon product is the lexicographically minimal sequence obtainable by shuffling the sequences together, and a co-Lyndon word is a finite sequence that is prime with respect to the co-Lyndon product, or, equivalently, a finite sequence that is lexicographically strictly greater than all of its cyclic rotations. For example, (1001) has sorted co-Lyndon factorization (1)(100).

%C A sequence of words is uniform if they all have the same length.

%C Conjecture: Also the number of compositions of n that are either weakly increasing or weakly decreasing. Hence a(n) = 2 * A000041(n) - A000005(n). - _Gus Wiseman_, Mar 05 2020

%e The a(1) = 1 through a(6) = 18 compositions:

%e (1) (2) (3) (4) (5) (6)

%e (11) (12) (13) (14) (15)

%e (21) (22) (23) (24)

%e (111) (31) (32) (33)

%e (112) (41) (42)

%e (211) (113) (51)

%e (1111) (122) (114)

%e (221) (123)

%e (311) (222)

%e (1112) (321)

%e (2111) (411)

%e (11111) (1113)

%e (1122)

%e (2211)

%e (3111)

%e (11112)

%e (21111)

%e (111111)

%t lynQ[q_]:=Array[Union[{q,RotateRight[q,#]}]=={q,RotateRight[q,#]}&,Length[q]-1,1,And];

%t lynfac[q_]:=If[Length[q]==0,{},Function[i,Prepend[lynfac[Drop[q,i]],Take[q,i]]][Last[Select[Range[Length[q]],lynQ[Take[q,#]]&]]]];

%t colynQ[q_]:=Array[Union[{RotateRight[q,#],q}]=={RotateRight[q,#],q}&,Length[q]-1,1,And];

%t colynfac[q_]:=If[Length[q]==0,{},Function[i,Prepend[colynfac[Drop[q,i]],Take[q,i]]]@Last[Select[Range[Length[q]],colynQ[Take[q,#]]&]]];

%t Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],SameQ@@Length/@lynfac[#]&&SameQ@@Length/@colynfac[#]&]],{n,10}]

%Y Lyndon and co-Lyndon compositions are (both) counted by A059966.

%Y Lyndon compositions that are not weakly increasing are A329141.

%Y Lyndon compositions whose reverse is not co-Lyndon are A329324.

%Y Cf. A000740, A001037, A001523, A008965, A059204, A060223, A211100, A328596, A329312, A329318, A329396, A329397, A329399, A332578, A332669, A332834.

%K nonn,more

%O 1,2

%A _Gus Wiseman_, Nov 13 2019

%E a(19)-a(25) from _Robert Price_, Jun 20 2021