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.

Showing 1-4 of 4 results.

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

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Nov 13 2019

Keywords

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

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

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.

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

A329399 Numbers whose reversed binary expansion has uniform Lyndon factorization.

Original entry on oeis.org

1, 2, 3, 4, 6, 7, 8, 10, 12, 14, 15, 16, 20, 24, 26, 28, 30, 31, 32, 36, 38, 40, 42, 44, 48, 52, 54, 56, 58, 60, 62, 63, 64, 72, 80, 84, 88, 92, 96, 100, 104, 106, 108, 112, 116, 118, 120, 122, 124, 126, 127, 128, 136, 140, 142, 144, 152, 160, 164, 168, 170
Offset: 1

Views

Author

Gus Wiseman, Nov 13 2019

Keywords

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).
A sequence of words is uniform if they all have the same length.

Examples

			The sequence of terms together with their reversed binary expansions and Lyndon factorizations begins:
   1:      (1) = (1)
   2:     (01) = (01)
   3:     (11) = (1)(1)
   4:    (001) = (001)
   6:    (011) = (011)
   7:    (111) = (1)(1)(1)
   8:   (0001) = (0001)
  10:   (0101) = (01)(01)
  12:   (0011) = (0011)
  14:   (0111) = (0111)
  15:   (1111) = (1)(1)(1)(1)
  16:  (00001) = (00001)
  20:  (00101) = (00101)
  24:  (00011) = (00011)
  26:  (01011) = (01011)
  28:  (00111) = (00111)
  30:  (01111) = (01111)
  31:  (11111) = (1)(1)(1)(1)(1)
  32: (000001) = (000001)
  36: (001001) = (001)(001)
  38: (011001) = (011)(001)
  40: (000101) = (000101)
  42: (010101) = (01)(01)(01)
  44: (001101) = (001101)
  48: (000011) = (000011)
		

Crossrefs

Numbers whose binary expansion has uniform Lyndon factorization and uniform co-Lyndon factorization are A023758.
Numbers whose reversed binary expansion is Lyndon are A328596.
Numbers whose binary expansion is co-Lyndon are A275692.
Numbers whose trimmed binary expansion has Lyndon and co-Lyndon factorizations of equal lengths are A329395.

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,#]]&]]]];
    Select[Range[100],SameQ@@Length/@lynfac[Reverse[IntegerDigits[#,2]]]&]

A329401 Numbers whose binary expansion without the most significant (first) digit is a co-Lyndon word.

Original entry on oeis.org

2, 3, 6, 12, 14, 24, 28, 30, 48, 52, 56, 58, 60, 62, 96, 104, 112, 114, 116, 120, 122, 124, 126, 192, 200, 208, 212, 224, 226, 228, 232, 234, 236, 240, 242, 244, 246, 248, 250, 252, 254, 384, 400, 416, 420, 424, 448, 450, 452, 456, 458, 464, 466, 468, 472, 474
Offset: 1

Views

Author

Gus Wiseman, Nov 16 2019

Keywords

Comments

A co-Lyndon word is a finite sequence that is lexicographically strictly greater than all of its cyclic rotations.

Examples

			The sequence of terms together with their binary expansions begins:
    2: (1,0)
    3: (1,1)
    6: (1,1,0)
   12: (1,1,0,0)
   14: (1,1,1,0)
   24: (1,1,0,0,0)
   28: (1,1,1,0,0)
   30: (1,1,1,1,0)
   48: (1,1,0,0,0,0)
   52: (1,1,0,1,0,0)
   56: (1,1,1,0,0,0)
   58: (1,1,1,0,1,0)
   60: (1,1,1,1,0,0)
   62: (1,1,1,1,1,0)
   96: (1,1,0,0,0,0,0)
  104: (1,1,0,1,0,0,0)
  112: (1,1,1,0,0,0,0)
  114: (1,1,1,0,0,1,0)
  116: (1,1,1,0,1,0,0)
  120: (1,1,1,1,0,0,0)
		

Crossrefs

The version involving all digits is A275692.
Binary Lyndon/co-Lyndon words are A001037.
A ranking of binary co-Lyndon words is A329318

Programs

  • Mathematica
    colynQ[q_]:=Array[Union[{RotateRight[q,#],q}]=={RotateRight[q,#],q}&,Length[q]-1,1,And];
    Select[Range[2,100],colynQ[Rest[IntegerDigits[#,2]]]&]

A329397 Number of compositions of n whose Lyndon factorization is uniform.

Original entry on oeis.org

1, 2, 4, 7, 12, 20, 33, 55, 92, 156, 267, 466, 822, 1473, 2668, 4886, 9021, 16786, 31413, 59101, 111654, 211722, 402697, 768025, 1468170, 2812471, 5397602, 10376418, 19978238, 38519537, 74365161, 143742338, 278156642, 538831403, 1044830113, 2027879831
Offset: 1

Views

Author

Gus Wiseman, Nov 13 2019

Keywords

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).
A sequence of words is uniform if they all have the same length.

Examples

			The a(1) = 1 through a(6) = 20 Lyndon factorizations:
  (1)  (2)     (3)        (4)           (5)              (6)
       (1)(1)  (12)       (13)          (14)             (15)
               (2)(1)     (112)         (23)             (24)
               (1)(1)(1)  (2)(2)        (113)            (114)
                          (3)(1)        (122)            (123)
                          (2)(1)(1)     (1112)           (132)
                          (1)(1)(1)(1)  (3)(2)           (1113)
                                        (4)(1)           (1122)
                                        (2)(2)(1)        (3)(3)
                                        (3)(1)(1)        (4)(2)
                                        (2)(1)(1)(1)     (5)(1)
                                        (1)(1)(1)(1)(1)  (11112)
                                                         (12)(12)
                                                         (2)(2)(2)
                                                         (3)(2)(1)
                                                         (4)(1)(1)
                                                         (2)(2)(1)(1)
                                                         (3)(1)(1)(1)
                                                         (2)(1)(1)(1)(1)
                                                         (1)(1)(1)(1)(1)(1)
		

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.

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,#]]&]]]];
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],SameQ@@Length/@lynfac[#]&]],{n,10}]
  • PARI
    EulerT(v)={Vec(exp(x*Ser(dirmul(v,vector(#v,n,1/n))))-1, -#v)}
    B(n,k) = {sumdiv(n, d, moebius(d)/(1-x^d)^(n/d) + O(x*x^k))/n}
    seq(n) = {sum(d=1, n-1, my(v=Vec(B(d,n-d),-n)); EulerT(v))} \\ Andrew Howroyd, Feb 03 2022

Formula

G.f.: Sum_{r>=1} (exp(Sum_{k>=1} B(r, x^k)/k) - 1) where B(r, x) = (Sum_{d|r} mu(d)/(1 - x^d)^(r/d))*x^r/r. - Andrew Howroyd, Feb 03 2022

Extensions

a(19)-a(25) from Robert Price, Jun 20 2021
Terms a(26) and beyond from Andrew Howroyd, Feb 03 2022
Showing 1-4 of 4 results.