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.

Previous Showing 11-17 of 17 results.

A211096 Smallest (i.e., rightmost) Lyndon word in the Lyndon factorization of the binary representation of n (written using 1's and 2's rather than 0's and 1's, since numbers > 0 in the OEIS cannot begin with 0).

Original entry on oeis.org

1, 2, 1, 2, 1, 12, 1, 2, 1, 112, 1, 122, 1, 12, 1, 2, 1, 1112, 1, 1122, 1, 12, 1, 1222, 1, 112, 1, 122, 1, 12, 1, 2, 1, 11112, 1, 11122, 1, 11212, 1, 11222, 1, 112, 1, 12122, 1, 12, 1, 12222, 1, 1112, 1, 1122, 1, 12, 1, 1222, 1, 112, 1, 122, 1, 12, 1, 2, 1, 111112, 1, 111122, 1, 111212, 1, 111222, 1, 112, 1, 112122, 1, 112212, 1, 112222, 1, 1112, 1, 1122, 1
Offset: 0

Views

Author

N. J. A. Sloane, Mar 31 2012

Keywords

Comments

See A211095 and A211097 for further information, including Maple programs.

Examples

			n=25 has binary expansion 11001, which has Lyndon factorization (1)(1)(001) with three factors. The rightmost factor is 001, which we write as a(25) = 112.
The real sequence (written with 0's and 1's rather than 1's and 2's) is:
0, 1, 0, 1, 0, 01, 0, 1, 0, 001, 0, 011, 0, 01, 0, 1, 0, 0001, 0, 0011, 0, 01, 0, 0111, 0, 001, 0, 011, 0, 01, 0, 1, 0, 00001, 0, 00011, 0, 00101, 0, 00111, 0, 001, 0, 01011, 0, 01, 0, 01111, 0, 0001, 0, 0011, 0, 01, 0, 0111, 0, 001, 0, 011, ...
		

Crossrefs

Formula

a(2k) is always 1 (i.e., 0).

A334297 Length of the Lyndon factorization of the reversed n-th composition in standard order.

Original entry on oeis.org

0, 1, 1, 2, 1, 1, 2, 3, 1, 1, 2, 1, 2, 2, 3, 4, 1, 1, 1, 1, 2, 1, 2, 1, 2, 2, 3, 2, 3, 3, 4, 5, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 3, 1, 2, 2, 2, 1, 2, 2, 2, 2, 3, 2, 3, 2, 3, 3, 4, 3, 4, 4, 5, 6, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 2
Offset: 0

Views

Author

Gus Wiseman, Apr 25 2020

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. 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).
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 12345th composition is (1,7,1,1,3,1), with reverse (1,3,1,1,7,1), with Lyndon factorization ((1),(1,3),(1,1,7)), so a(12345) = 3.
		

Crossrefs

The non-reversed version is A329312.
The version for binary indices is A329313 (also the "co-" version).
Positions of 1's are A334265 (reversed Lyndon words).
Binary Lyndon words are counted by A001037 and ranked by A102659.
Lyndon compositions are counted by A059966 and ranked by A275692.
Normal Lyndon sequences are counted by A060223 (row sums of A296372).
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.
- Co-Lyndon words are A326774.
- Reversed co-Lyndon words are A328596.
- Aperiodic compositions are A328594.
- Distinct rotations are counted by A333632.
- Lyndon factorizations are counted by A333940.
- Length of co-Lyndon factorization is A334029.

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,#]}]=={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[lynfac[Reverse[stc[n]]]],{n,0,100}]

A329400 Length of the co-Lyndon factorization of the binary expansion of n with the most significant (first) digit removed.

Original entry on oeis.org

0, 1, 1, 2, 2, 1, 2, 3, 3, 2, 3, 1, 2, 1, 3, 4, 4, 3, 4, 2, 3, 2, 4, 1, 2, 2, 3, 1, 2, 1, 4, 5, 5, 4, 5, 3, 4, 3, 5, 2, 3, 3, 4, 2, 3, 2, 5, 1, 2, 2, 3, 1, 3, 2, 4, 1, 2, 1, 3, 1, 2, 1, 5, 6, 6, 5, 6, 4, 5, 4, 6, 3, 4, 4, 5, 3, 4, 3, 6, 2, 3, 3, 4, 2, 4, 3, 5
Offset: 1

Views

Author

Gus Wiseman, Nov 16 2019

Keywords

Comments

The co-Lyndon product of two or more finite sequences is defined to be the lexicographically minimal sequence obtainable by shuffling the sequences together. For example, the co-Lyndon product of (231) and (213) is (212313), the product of (221) and (213) is (212213), and the product of (122) and (2121) is (1212122). A co-Lyndon word is a finite sequence that is prime with respect to the co-Lyndon product. Equivalently, a co-Lyndon word is a finite sequence that is lexicographically strictly greater than all of its cyclic rotations. Every finite sequence has a unique (orderless) factorization into co-Lyndon words, and if these factors are arranged in a certain order, their concatenation is equal to their co-Lyndon product. For example, (1001) has sorted co-Lyndon factorization (1)(100).

Examples

			Decapitated binary expansions of 1..20 together with their co-Lyndon factorizations:
   1:     () =
   2:    (0) = (0)
   3:    (1) = (1)
   4:   (00) = (0)(0)
   5:   (01) = (0)(1)
   6:   (10) = (10)
   7:   (11) = (1)(1)
   8:  (000) = (0)(0)(0)
   9:  (001) = (0)(0)(1)
  10:  (010) = (0)(10)
  11:  (011) = (0)(1)(1)
  12:  (100) = (100)
  13:  (101) = (10)(1)
  14:  (110) = (110)
  15:  (111) = (1)(1)(1)
  16: (0000) = (0)(0)(0)(0)
  17: (0001) = (0)(0)(0)(1)
  18: (0010) = (0)(0)(10)
  19: (0011) = (0)(0)(1)(1)
  20: (0100) = (0)(100)
		

Crossrefs

The non-"co" version is A211097.
The version involving all digits is A329312.
Lyndon and co-Lyndon compositions are (both) counted by A059966.
Numbers whose reversed binary expansion is Lyndon are A328596.
Numbers whose binary expansion is co-Lyndon are A275692.
Numbers whose decapitated binary expansion is co-Lyndon are A329401.

Programs

  • Mathematica
    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[If[n==0,0,Length[colynfac[Rest[IntegerDigits[n,2]]]]],{n,30}]

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

A211098 Length of largest (i.e., leftmost) Lyndon word in Lyndon factorization of binary vectors of lengths 1, 2, 3, ...

Original entry on oeis.org

1, 1, 1, 2, 1, 1, 1, 3, 2, 3, 1, 1, 1, 1, 1, 4, 3, 4, 2, 2, 3, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 4, 5, 3, 5, 4, 5, 2, 2, 2, 5, 3, 3, 4, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 6, 5, 6, 4, 6, 5, 6, 3, 3, 5, 6, 4, 6, 5, 6, 2, 2, 2, 2, 2, 2, 5, 6, 3, 3, 3, 3, 4, 4, 5, 6, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
Offset: 1

Views

Author

N. J. A. Sloane, Apr 01 2012

Keywords

Comments

Any binary word has a unique factorization as a product of nonincreasing Lyndon words (see Lothaire). Here we look at the Lyndon factorizations of the binary vectors 0,1, 00,01,10,11, 000,001,010,011,100,101,110,111, 0000,...
See A211097, A211099, A211100 for further information, including Maple code.
The smallest (or rightmost) factors are given by A211095 and A211096, offset by 2.

Examples

			Here are the Lyndon factorizations of the first few binary vectors:
.0.
.1.
.0.0.
.01.
.1.0.
.1.1.
.0.0.0.
.001.
.01.0.
.011.
.1.0.0.
.1.01.
.1.1.0.
.1.1.1.
.0.0.0.0.
...
		

References

  • M. Lothaire, Combinatorics on Words, Addison-Wesley, Reading, MA, 1983. See Theorem 5.1.5, p. 67.
  • G. Melançon, Factorizing infinite words using Maple, MapleTech Journal, vol. 4, no. 1, 1997, pp. 34-42

Crossrefs

Cf. A001037 (number of Lyndon words of length m); A102659 (list thereof), A211100.

A329357 Numbers whose reversed binary expansion has co-Lyndon factorization of length 2.

Original entry on oeis.org

2, 3, 5, 9, 11, 17, 19, 23, 33, 35, 37, 39, 43, 47, 65, 67, 69, 71, 75, 79, 83, 87, 95, 129, 131, 133, 135, 137, 139, 143, 147, 149, 151, 155, 159, 163, 167, 171, 175, 183, 191, 257, 259, 261, 263, 265, 267, 271, 275, 277, 279, 283, 287, 291, 293, 295, 299
Offset: 1

Views

Author

Gus Wiseman, Nov 12 2019

Keywords

Comments

First differs from A329327 in lacking 77 and having 83.
The co-Lyndon product of two or more finite sequences is defined to be the lexicographically minimal sequence obtainable by shuffling the sequences together. For example, the co-Lyndon product of (231) and (213) is (212313), the product of (221) and (213) is (212213), and the product of (122) and (2121) is (1212122). A co-Lyndon word is a finite sequence that is prime with respect to the co-Lyndon product. Equivalently, a co-Lyndon word is a finite sequence that is lexicographically strictly greater than all of its cyclic rotations. Every finite sequence has a unique (orderless) factorization into co-Lyndon words, and if these factors are arranged in a certain order, their concatenation is equal to their co-Lyndon product. For example, (1001) has sorted co-Lyndon factorization (1)(100).

Examples

			The reversed binary expansion of each term together with their co-Lyndon factorizations:
   2:      (01) = (0)(1)
   3:      (11) = (1)(1)
   5:     (101) = (10)(1)
   9:    (1001) = (100)(1)
  11:    (1101) = (110)(1)
  17:   (10001) = (1000)(1)
  19:   (11001) = (1100)(1)
  23:   (11101) = (1110)(1)
  33:  (100001) = (10000)(1)
  35:  (110001) = (11000)(1)
  37:  (101001) = (10100)(1)
  39:  (111001) = (11100)(1)
  43:  (110101) = (11010)(1)
  47:  (111101) = (11110)(1)
  65: (1000001) = (100000)(1)
  67: (1100001) = (110000)(1)
  69: (1010001) = (101000)(1)
  71: (1110001) = (111000)(1)
  75: (1101001) = (110100)(1)
  79: (1111001) = (111100)(1)
		

Crossrefs

Positions of 2's in A329326.
Binary co-Lyndon words are counted by A001037 and ranked by A329318.
Length of the co-Lyndon factorization of the binary expansion is A329312.

Programs

  • Mathematica
    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,#]]&]]];
    Select[Range[100],Length[colynfac[Reverse[IntegerDigits[#,2]]]]==2&]

A329359 Irregular triangle read by rows where row n gives the lengths of the factors in the co-Lyndon factorization of the binary expansion of n.

Original entry on oeis.org

1, 2, 1, 1, 3, 2, 1, 3, 1, 1, 1, 4, 3, 1, 2, 2, 2, 1, 1, 4, 3, 1, 4, 1, 1, 1, 1, 5, 4, 1, 3, 2, 3, 1, 1, 5, 2, 2, 1, 2, 3, 2, 1, 1, 1, 5, 4, 1, 5, 3, 1, 1, 5, 4, 1, 5, 1, 1, 1, 1, 1, 6, 5, 1, 4, 2, 4, 1, 1, 3, 3, 3, 2, 1, 3, 3, 3, 1, 1, 1, 6, 5, 1, 2, 2, 2, 2
Offset: 1

Views

Author

Gus Wiseman, Nov 12 2019

Keywords

Comments

The co-Lyndon product of two or more finite sequences is defined to be the lexicographically minimal sequence obtainable by shuffling the sequences together. For example, the co-Lyndon product of (231) and (213) is (212313), the product of (221) and (213) is (212213), and the product of (122) and (2121) is (1212122). A co-Lyndon word is a finite sequence that is prime with respect to the co-Lyndon product. Equivalently, a co-Lyndon word is a finite sequence that is lexicographically strictly greater than all of its cyclic rotations. Every finite sequence has a unique (orderless) factorization into co-Lyndon words, and if these factors are arranged in a certain order, their concatenation is equal to their co-Lyndon product. For example, (1001) has sorted co-Lyndon factorization (1)(100).

Examples

			Triangle begins:
   1: (1)       21: (221)      41: (51)       61: (51)
   2: (2)       22: (23)       42: (222)      62: (6)
   3: (11)      23: (2111)     43: (2211)     63: (111111)
   4: (3)       24: (5)        44: (24)       64: (7)
   5: (21)      25: (41)       45: (231)      65: (61)
   6: (3)       26: (5)        46: (24)       66: (52)
   7: (111)     27: (311)      47: (21111)    67: (511)
   8: (4)       28: (5)        48: (6)        68: (43)
   9: (31)      29: (41)       49: (51)       69: (421)
  10: (22)      30: (5)        50: (6)        70: (43)
  11: (211)     31: (11111)    51: (411)      71: (4111)
  12: (4)       32: (6)        52: (6)        72: (7)
  13: (31)      33: (51)       53: (51)       73: (331)
  14: (4)       34: (42)       54: (33)       74: (322)
  15: (1111)    35: (411)      55: (3111)     75: (3211)
  16: (5)       36: (33)       56: (6)        76: (34)
  17: (41)      37: (321)      57: (51)       77: (331)
  18: (32)      38: (33)       58: (6)        78: (34)
  19: (311)     39: (3111)     59: (411)      79: (31111)
  20: (5)       40: (6)        60: (6)        80: (7)
For example, 45 has binary expansion (101101), with co-Lyndon factorization (10)(110)(1), so row n = 45 is (2,3,1).
		

Crossrefs

Row lengths are A329312.
Row sums are A070939.
Positions of rows of length 1 are A275692.
The non-"co" version is A329314.
Binary co-Lyndon words are counted by A001037 and ranked by A329318.

Programs

  • Mathematica
    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/@colynfac[If[n==0,{},IntegerDigits[n,2]]],{n,30}]
Previous Showing 11-17 of 17 results.