login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A329394 Number of compositions of n whose Lyndon and co-Lyndon factorizations both have the same length. 2
1, 2, 2, 4, 4, 10, 13, 28, 46, 99, 175, 359, 672, 1358, 2627, 5238, 10262, 20438, 40320, 80137 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
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).
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).
LINKS
EXAMPLE
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)
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}]
CROSSREFS
Lyndon and co-Lyndon compositions are (both) counted by A059966.
Lyndon compositions that are not weakly increasing are A329141.
Lyndon compositions of n whose reverse is not co-Lyndon are A329324.
Sequence in context: A005293 A287488 A320434 * A057784 A209284 A321468
KEYWORD
nonn,more
AUTHOR
Gus Wiseman, Nov 13 2019
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 01:06 EDT 2024. Contains 371964 sequences. (Running on oeis4.)