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-5 of 5 results.

A334269 Number of compositions of n that are both a reversed Lyndon word and a co-Lyndon word.

Original entry on oeis.org

1, 1, 2, 3, 6, 8, 16, 23, 40, 62, 110, 169, 302, 492, 856, 1454, 2572, 4428, 7914, 13935, 25036, 44842, 81298, 147149, 268952, 491746, 904594, 1667091, 3085950, 5723367, 10652544, 19865887, 37150314, 69608939, 130723184, 245935633, 463590444, 875306913, 1655451592, 3135613649, 5948011978, 11298215516
Offset: 1

Views

Author

Gus Wiseman, Apr 24 2020

Keywords

Comments

Also the number of compositions of n that are both a Lyndon word and a reversed co-Lyndon word.
A composition of n is a finite sequence of positive integers summing to n.
A Lyndon word is a finite sequence of positive integers that is lexicographically strictly less than all of its cyclic rotations. Co-Lyndon is defined similarly, except with strictly greater instead of strictly less.

Examples

			The a(1) = 1 through a(7) = 16 compositions:
  (1)  (2)  (3)   (4)    (5)     (6)      (7)
            (21)  (31)   (32)    (42)     (43)
                  (211)  (41)    (51)     (52)
                         (221)   (321)    (61)
                         (311)   (411)    (322)
                         (2111)  (2211)   (331)
                                 (3111)   (421)
                                 (21111)  (511)
                                          (2221)
                                          (3121)
                                          (3211)
                                          (4111)
                                          (21211)
                                          (22111)
                                          (31111)
                                          (211111)
		

Crossrefs

The version for binary expansion is A334267.
Compositions of this type are ranked by A334266.
Normal sequences of this type are counted by A334270.
Necklace compositions of this type are counted by A334271.
Aperiodic compositions are counted by A000740.
Binary Lyndon words are counted by A001037.
Necklace compositions are counted by A008965.
Normal Lyndon words are counted by A060223.
Lyndon compositions are counted by A059966.
All of the following pertain to compositions in standard order (A066099):
- Lyndon words are A275692.
- Co-Lyndon words are A326774.
- Reversed Lyndon words are A334265.
- Reversed co-Lyndon words are A328596.
- Length of Lyndon factorization is A329312.
- Length of co-Lyndon factorization is A334029.
- Length of Lyndon factorization of reverse is A334297.
- Length of co-Lyndon factorization of reverse is A329313.
- Lyndon factorizations are counted by A333940.
- Co-Lyndon factorizations are counted by A333765.
- Aperiodic compositions are A328594.
- Distinct rotations are counted by A333632.

Programs

  • Mathematica
    lynQ[q_]:=Length[q]==0||Array[Union[{q,RotateRight[q,#1]}]=={q,RotateRight[q,#1]}&,Length[q]-1,1,And];
    colynQ[q_]:=Length[q]==0||Array[Union[{RotateRight[q,#],q}]=={RotateRight[q,#],q}&,Length[q]-1,1,And];
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],lynQ[Reverse[#]]&&colynQ[#]&]],{n,0,15}]

Extensions

Offset corrected and a(21)-a(42) from Bert Dobbelaere, Apr 26 2020

A334271 Number of compositions of n that are both a reversed necklace and a co-necklace.

Original entry on oeis.org

1, 1, 2, 3, 5, 7, 12, 17, 28, 43, 70, 111, 184, 303, 510, 865, 1482, 2573, 4480, 7915, 14008
Offset: 0

Views

Author

Gus Wiseman, Apr 25 2020

Keywords

Comments

Also the number of compositions of n that are both a necklace and a reversed co-necklace.
A necklace is a finite sequence of positive integers that is lexicographically less than or equal to any cyclic rotation. Co-necklace is defined similarly, except with greater instead of less.

Examples

			The a(1) = 1 through a(6) = 12 compositions:
  (1)  (2)   (3)    (4)     (5)      (6)
       (11)  (21)   (22)    (32)     (33)
             (111)  (31)    (41)     (42)
                    (211)   (221)    (51)
                    (1111)  (311)    (222)
                            (2111)   (321)
                            (11111)  (411)
                                     (2121)
                                     (2211)
                                     (3111)
                                     (21111)
                                     (111111)
		

Crossrefs

Normal sequences of this type are counted by A334272.
The aperiodic case is A334269.
These compositions are ranked by A334273.
Binary (or reversed binary) necklaces are counted by A000031.
Normal sequences are counted by A000670.
Necklace compositions are counted by A008965.
Lyndon compositions are counted by A059966.
Normal Lyndon words are counted by A060223.
Normal necklaces are counted by A019536.
Normal aperiodic words are counted by A296975.
All of the following pertain to compositions in standard order (A066099):
- Necklaces are A065609.
- Reversed necklaces are A333943.
- Co-necklaces are A333764.
- Reversed co-necklaces are A328595.
- Lyndon words are A275692.
- Co-Lyndon words are A326774.
- Reversed Lyndon words are A334265.
- Reversed co-Lyndon words are A328596.
- Aperiodic compositions are A328594.

Programs

  • Mathematica
    neckQ[q_]:=Length[q]==0||Array[OrderedQ[{q,RotateRight[q,#]}]&,Length[q]-1,1,And];
    coneckQ[q_]:=Length[q]==0||Array[OrderedQ[{RotateRight[q,#],q}]&,Length[q]-1,1,And];
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],neckQ[Reverse[#]]&&coneckQ[#]&]],{n,0,15}]

A334272 Number of sequences of length n that cover an initial interval of positive integers and are both a reversed necklace and a co-necklace.

Original entry on oeis.org

1, 1, 2, 4, 12, 43, 229, 1506, 12392, 120443
Offset: 0

Views

Author

Gus Wiseman, Apr 25 2020

Keywords

Comments

A necklace is a finite sequence of positive integers that is lexicographically strictly less than or equal to any cyclic rotation. Co-necklace is defined similarly, except with strictly greater instead of strictly less.

Examples

			The a(1) = 1 through a(4) = 12 normal sequences:
  (1)  (1,1)  (1,1,1)  (1,1,1,1)
       (2,1)  (2,1,1)  (2,1,1,1)
              (2,2,1)  (2,1,2,1)
              (3,2,1)  (2,2,1,1)
                       (2,2,2,1)
                       (3,1,2,1)
                       (3,2,1,1)
                       (3,2,2,1)
                       (3,2,3,1)
                       (3,3,2,1)
                       (4,2,3,1)
                       (4,3,2,1)
		

Crossrefs

Dominates A334270 (the aperiodic case).
Compositions of this type are counted by A334271.
These compositions are ranked by A334273 (standard) and A334274 (binary).
Binary (or reversed binary) necklaces are counted by A000031.
Normal sequences are counted by A000670.
Necklace compositions are counted by A008965.
Normal Lyndon words are counted by A060223.
Normal necklaces are counted by A019536.
All of the following pertain to compositions in standard order (A066099):
- Necklaces are A065609.
- Reversed necklaces are A333943.
- Co-necklaces are A333764.
- Reversed co-necklaces are A328595.
- Lyndon words are A275692.
- Co-Lyndon words are A326774.
- Reversed Lyndon words are A334265.
- Reversed co-Lyndon words are A328596.
- Reversed Lyndon co-Lyndon compositions are A334266.
- Aperiodic compositions are A328594.

Programs

  • Mathematica
    neckQ[q_]:=Length[q]==0||Array[OrderedQ[{q,RotateRight[q,#]}]&,Length[q]-1,1,And];
    coneckQ[q_]:=Length[q]==0||Array[OrderedQ[{RotateRight[q,#],q}]&,Length[q]-1,1,And];
    allnorm[n_]:=If[n<=0,{{}},Function[s,Array[Count[s,y_/;y<=#]+1&,n]]/@Subsets[Range[n-1]+1]];
    Table[Length[Select[Join@@Permutations/@allnorm[n],neckQ[Reverse[#]]&&coneckQ[#]&]],{n,0,8}]

A334267 Numbers k such that the k-th composition in standard order is both a Lyndon word and a reversed co-Lyndon word.

Original entry on oeis.org

0, 1, 2, 4, 6, 8, 12, 14, 16, 20, 24, 26, 28, 30, 32, 40, 48, 52, 56, 58, 60, 62, 64, 72, 80, 84, 96, 100, 104, 106, 108, 112, 116, 118, 120, 122, 124, 126, 128, 144, 160, 164, 168, 192, 200, 208, 212, 216, 218, 224, 228, 232, 234, 236, 240, 244, 246, 248, 250
Offset: 1

Views

Author

Gus Wiseman, Apr 22 2020

Keywords

Comments

Also numbers whose binary expansion is both a reversed Lyndon word and a co-Lyndon word.
A Lyndon word is a finite sequence of positive integers that is lexicographically strictly less than all of its cyclic rotations. Co-Lyndon is defined similarly, except with strictly greater instead of strictly less.
The k-th composition in standard order (graded reverse-lexicographic, A066099) is obtained by taking the set of positions of 1's in the reversed binary expansion of k, prepending 0, taking first differences, and reversing again. This gives a bijective correspondence between nonnegative integers and integer compositions.

Examples

			The sequence of all reversed co-Lyndon Lyndon words begins:
    0: ()            56: (1,1,4)        124: (1,1,1,1,3)
    1: (1)           58: (1,1,2,2)      126: (1,1,1,1,1,2)
    2: (2)           60: (1,1,1,3)      128: (8)
    4: (3)           62: (1,1,1,1,2)    144: (3,5)
    6: (1,2)         64: (7)            160: (2,6)
    8: (4)           72: (3,4)          164: (2,3,3)
   12: (1,3)         80: (2,5)          168: (2,2,4)
   14: (1,1,2)       84: (2,2,3)        192: (1,7)
   16: (5)           96: (1,6)          200: (1,3,4)
   20: (2,3)        100: (1,3,3)        208: (1,2,5)
   24: (1,4)        104: (1,2,4)        212: (1,2,2,3)
   26: (1,2,2)      106: (1,2,2,2)      216: (1,2,1,4)
   28: (1,1,3)      108: (1,2,1,3)      218: (1,2,1,2,2)
   30: (1,1,1,2)    112: (1,1,5)        224: (1,1,6)
   32: (6)          116: (1,1,2,3)      228: (1,1,3,3)
   40: (2,4)        118: (1,1,2,1,2)    232: (1,1,2,4)
   48: (1,5)        120: (1,1,1,4)      234: (1,1,2,2,2)
   52: (1,2,3)      122: (1,1,1,2,2)    236: (1,1,2,1,3)
The sequence of terms together with their binary expansions and binary indices begins:
    0:      0 ~ {}            56:  111000 ~ {4,5,6}
    1:      1 ~ {1}           58:  111010 ~ {2,4,5,6}
    2:     10 ~ {2}           60:  111100 ~ {3,4,5,6}
    4:    100 ~ {3}           62:  111110 ~ {2,3,4,5,6}
    6:    110 ~ {2,3}         64: 1000000 ~ {7}
    8:   1000 ~ {4}           72: 1001000 ~ {4,7}
   12:   1100 ~ {3,4}         80: 1010000 ~ {5,7}
   14:   1110 ~ {2,3,4}       84: 1010100 ~ {3,5,7}
   16:  10000 ~ {5}           96: 1100000 ~ {6,7}
   20:  10100 ~ {3,5}        100: 1100100 ~ {3,6,7}
   24:  11000 ~ {4,5}        104: 1101000 ~ {4,6,7}
   26:  11010 ~ {2,4,5}      106: 1101010 ~ {2,4,6,7}
   28:  11100 ~ {3,4,5}      108: 1101100 ~ {3,4,6,7}
   30:  11110 ~ {2,3,4,5}    112: 1110000 ~ {5,6,7}
   32: 100000 ~ {6}          116: 1110100 ~ {3,5,6,7}
   40: 101000 ~ {4,6}        118: 1110110 ~ {2,3,5,6,7}
   48: 110000 ~ {5,6}        120: 1111000 ~ {4,5,6,7}
   52: 110100 ~ {3,5,6}      122: 1111010 ~ {2,4,5,6,7}
		

Crossrefs

Compositions of this type are counted by A334269.
Normal sequences of this type are counted by A334270.
Necklaces of this type are counted by A334271.
Necklaces of this type are ranked by A334274.
Binary (or reversed binary) Lyndon words are counted by A001037.
Lyndon compositions are counted by A059966.
Lyndon words whose reverse is not co-Lyndon are counted by A329324
Reversed Lyndon co-Lyndon compositions are ranked by A334266.
All of the following pertain to compositions in standard order (A066099):
- Length is A000120.
- Necklaces are A065609.
- Sum is A070939.
- Reverse is A228351 (triangle).
- Strict compositions are A233564.
- Constant compositions are A272919.
- Lyndon words are A275692.
- Reversed Lyndon words are A334265.
- Co-Lyndon words are A326774.
- Reversed co-Lyndon words are A328596.
- Length of Lyndon factorization is A329312.
- Length of Lyndon factorization of reverse is A334297.
- Length of co-Lyndon factorization is A334029.
- Length of co-Lyndon factorization of reverse is A329313.
- Distinct rotations are counted by A333632.
- Lyndon factorizations are counted by A333940.
- Co-Lyndon factorizations are counted by A333765.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    lynQ[q_]:=Length[q]==0||Array[Union[{q,RotateRight[q,#1]}]=={q,RotateRight[q,#1]}&,Length[q]-1,1,And];
    colynQ[q_]:=Length[q]==0||Array[Union[{RotateRight[q,#],q}]=={RotateRight[q,#],q}&,Length[q]-1,1,And];
    Select[Range[0,100],colynQ[Reverse[stc[#]]]&&lynQ[stc[#]]&]

Formula

Intersection of A275692 and A328596.

A334270 Number of sequences of length n that cover an initial interval of positive integers and are both a reversed Lyndon word and a co-Lyndon word.

Original entry on oeis.org

1, 1, 1, 3, 10, 42, 224, 1505, 12380, 120439
Offset: 0

Views

Author

Gus Wiseman, Apr 24 2020

Keywords

Comments

Also the number of sequences of length n that cover an initial interval of positive integers and are both a Lyndon word and a reversed co-Lyndon word.
A Lyndon word is a finite sequence of positive integers that is lexicographically strictly less than all of its cyclic rotations. Co-Lyndon is defined similarly, except with strictly greater instead of strictly less.

Examples

			The a(1) = 1 through a(4) = 10 normal sequences:
  (1)  (2,1)  (2,1,1)  (2,1,1,1)
              (2,2,1)  (2,2,1,1)
              (3,2,1)  (2,2,2,1)
                       (3,1,2,1)
                       (3,2,1,1)
                       (3,2,2,1)
                       (3,2,3,1)
                       (3,3,2,1)
                       (4,2,3,1)
                       (4,3,2,1)
		

Crossrefs

These compositions are ranked by A334266 (standard) and A334267 (binary).
Compositions of this type are counted by A334269.
Necklace compositions of this type are counted by A334271.
Dominated by A334272 (the necklace version).
Normal sequences are counted by A000670.
Binary (or reversed binary) Lyndon words are counted by A001037.
Lyndon compositions are counted by A059966.
Normal Lyndon words are counted by A060223.
Normal sequences by length and Lyndon factorization length are A296372.
All of the following pertain to compositions in standard order (A066099):
- Lyndon words are A275692.
- Co-Lyndon words are A326774.
- Reversed Lyndon words are A334265.
- Reversed co-Lyndon words are A328596.
- Length of Lyndon factorization is A329312.
- Length of co-Lyndon factorization is A334029.
- Length of Lyndon factorization of reverse is A334297.
- Length of co-Lyndon factorization of reverse is A329313.

Programs

  • Mathematica
    lynQ[q_]:=Length[q]==0||Array[Union[{q,RotateRight[q,#1]}]=={q,RotateRight[q,#1]}&,Length[q]-1,1,And];
    colynQ[q_]:=Length[q]==0||Array[Union[{RotateRight[q,#],q}]=={RotateRight[q,#],q}&,Length[q]-1,1,And];
    allnorm[n_]:=If[n<=0,{{}},Function[s,Array[Count[s,y_/;y<=#]+1&,n]]/@Subsets[Range[n-1]+1]];
    Table[Length[Select[Join@@Permutations/@allnorm[n],lynQ[Reverse[#]]&&colynQ[#]&]],{n,0,6}]
Showing 1-5 of 5 results.