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.

A334265 Numbers k such that the k-th composition in standard order is a reversed Lyndon word.

Original entry on oeis.org

0, 1, 2, 4, 5, 8, 9, 11, 16, 17, 18, 19, 21, 23, 32, 33, 34, 35, 37, 39, 41, 43, 47, 64, 65, 66, 67, 68, 69, 71, 73, 74, 75, 77, 79, 81, 83, 85, 87, 91, 95, 128, 129, 130, 131, 132, 133, 135, 137, 138, 139, 141, 143, 145, 146, 147, 149, 151, 155, 159, 161, 163
Offset: 1

Views

Author

Gus Wiseman, Apr 22 2020

Keywords

Comments

Reversed Lyndon words are different from co-Lyndon words (A326774).
A Lyndon word is a finite sequence of positive integers that is lexicographically strictly less than all of its cyclic rotations.
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 Lyndon words begins:
    0: ()            37: (3,2,1)         83: (2,3,1,1)
    1: (1)           39: (3,1,1,1)       85: (2,2,2,1)
    2: (2)           41: (2,3,1)         87: (2,2,1,1,1)
    4: (3)           43: (2,2,1,1)       91: (2,1,2,1,1)
    5: (2,1)         47: (2,1,1,1,1)     95: (2,1,1,1,1,1)
    8: (4)           64: (7)            128: (8)
    9: (3,1)         65: (6,1)          129: (7,1)
   11: (2,1,1)       66: (5,2)          130: (6,2)
   16: (5)           67: (5,1,1)        131: (6,1,1)
   17: (4,1)         68: (4,3)          132: (5,3)
   18: (3,2)         69: (4,2,1)        133: (5,2,1)
   19: (3,1,1)       71: (4,1,1,1)      135: (5,1,1,1)
   21: (2,2,1)       73: (3,3,1)        137: (4,3,1)
   23: (2,1,1,1)     74: (3,2,2)        138: (4,2,2)
   32: (6)           75: (3,2,1,1)      139: (4,2,1,1)
   33: (5,1)         77: (3,1,2,1)      141: (4,1,2,1)
   34: (4,2)         79: (3,1,1,1,1)    143: (4,1,1,1,1)
   35: (4,1,1)       81: (2,4,1)        145: (3,4,1)
		

Crossrefs

The non-reversed version is A275692.
The generalization to necklaces is A333943.
The dual version (reversed co-Lyndon words) is A328596.
The case that is also co-Lyndon is A334266.
Binary Lyndon words are counted by A001037.
Lyndon compositions are counted by A059966.
Normal Lyndon words are counted by A060223.
Numbers whose prime signature is a reversed Lyndon word are A334298.
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 (this sequence).
- Co-Lyndon words are A326774.
- Reversed co-Lyndon words are A328596.
- Length of Lyndon factorization is A329312.
- Distinct rotations are counted by A333632.
- Lyndon factorizations are counted by A333940.
- Length of Lyndon factorization of reverse is A334297.

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];
    Select[Range[0,100],lynQ[Reverse[stc[#]]]&]

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

Original entry on oeis.org

0, 1, 2, 4, 5, 8, 9, 11, 16, 17, 18, 19, 21, 23, 32, 33, 34, 35, 37, 39, 43, 47, 64, 65, 66, 67, 68, 69, 71, 73, 74, 75, 77, 79, 85, 87, 91, 95, 128, 129, 130, 131, 132, 133, 135, 137, 138, 139, 141, 143, 146, 147, 149, 151, 155, 159, 171, 173, 175, 183, 191
Offset: 1

Views

Author

Gus Wiseman, Apr 22 2020

Keywords

Comments

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 Lyndon co-Lyndon words begins:
    0: ()            37: (3,2,1)         91: (2,1,2,1,1)
    1: (1)           39: (3,1,1,1)       95: (2,1,1,1,1,1)
    2: (2)           43: (2,2,1,1)      128: (8)
    4: (3)           47: (2,1,1,1,1)    129: (7,1)
    5: (2,1)         64: (7)            130: (6,2)
    8: (4)           65: (6,1)          131: (6,1,1)
    9: (3,1)         66: (5,2)          132: (5,3)
   11: (2,1,1)       67: (5,1,1)        133: (5,2,1)
   16: (5)           68: (4,3)          135: (5,1,1,1)
   17: (4,1)         69: (4,2,1)        137: (4,3,1)
   18: (3,2)         71: (4,1,1,1)      138: (4,2,2)
   19: (3,1,1)       73: (3,3,1)        139: (4,2,1,1)
   21: (2,2,1)       74: (3,2,2)        141: (4,1,2,1)
   23: (2,1,1,1)     75: (3,2,1,1)      143: (4,1,1,1,1)
   32: (6)           77: (3,1,2,1)      146: (3,3,2)
   33: (5,1)         79: (3,1,1,1,1)    147: (3,3,1,1)
   34: (4,2)         85: (2,2,2,1)      149: (3,2,2,1)
   35: (4,1,1)       87: (2,2,1,1,1)    151: (3,2,1,1,1)
		

Crossrefs

The version for binary expansion is A334267.
Compositions of this type are counted by A334269.
Normal sequences of this type are counted by A334270.
Necklace compositions of this type are counted by A334271.
Binary Lyndon words are counted by A001037.
Lyndon compositions are counted by A059966.
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.
- Co-Lyndon factorizations are counted by A333765.
- Lyndon factorizations are counted by A333940.

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],lynQ[Reverse[stc[#]]]&&colynQ[stc[#]]&]

Formula

Intersection of A334265 and A326774.

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

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.