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!)
A329398 Number of compositions of n with uniform Lyndon factorization and uniform co-Lyndon factorization. 33
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 (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).

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

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

LINKS

Table of n, a(n) for n=1..25.

EXAMPLE

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)

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}]

CROSSREFS

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

Lyndon compositions that are not weakly increasing are A329141.

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

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

Sequence in context: A343657 A033500 A003318 * A353150 A035300 A035296

Adjacent sequences: A329395 A329396 A329397 * A329399 A329400 A329401

KEYWORD

nonn,more

AUTHOR

Gus Wiseman, Nov 13 2019

EXTENSIONS

a(19)-a(25) from Robert Price, Jun 20 2021

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 February 26 11:45 EST 2023. Contains 360650 sequences. (Running on oeis4.)