cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A329394 Number of compositions of n whose Lyndon and co-Lyndon factorizations both have the same length.

This page as a plain text file.
%I A329394 #5 Nov 14 2019 12:58:17
%S A329394 1,2,2,4,4,10,13,28,46,99,175,359,672,1358,2627,5238,10262,20438,
%T A329394 40320,80137
%N A329394 Number of compositions of n whose Lyndon and co-Lyndon factorizations both have the same length.
%C A329394 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 A329394 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).
%e A329394 The a(1) = 1 through a(7) = 13 compositions:
%e A329394   (1)  (2)   (3)    (4)     (5)      (6)       (7)
%e A329394        (11)  (111)  (22)    (131)    (33)      (151)
%e A329394                     (121)   (212)    (141)     (214)
%e A329394                     (1111)  (11111)  (213)     (232)
%e A329394                                      (222)     (241)
%e A329394                                      (231)     (313)
%e A329394                                      (1221)    (1312)
%e A329394                                      (2112)    (1321)
%e A329394                                      (11211)   (2113)
%e A329394                                      (111111)  (11311)
%e A329394                                                (12121)
%e A329394                                                (21112)
%e A329394                                                (1111111)
%t A329394 lynQ[q_]:=Array[Union[{q,RotateRight[q,#]}]=={q,RotateRight[q,#]}&,Length[q]-1,1,And];
%t A329394 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 A329394 colynQ[q_]:=Array[Union[{RotateRight[q,#],q}]=={RotateRight[q,#],q}&,Length[q]-1,1,And];
%t A329394 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 A329394 Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],Length[lynfac[#]]==Length[colynfac[#]]&]],{n,10}]
%Y A329394 Lyndon and co-Lyndon compositions are (both) counted by A059966.
%Y A329394 Lyndon compositions that are not weakly increasing are A329141.
%Y A329394 Lyndon compositions of n whose reverse is not co-Lyndon are A329324.
%Y A329394 Cf. A000740, A001037, A008965, A060223, A102659, A211100, A275692, A328596, A329312, A329318, A329395, A329398.
%K A329394 nonn,more
%O A329394 1,2
%A A329394 _Gus Wiseman_, Nov 13 2019