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-10 of 47 results. Next

A275692 Numbers k such that every rotation of the binary digits of k is less than k.

Original entry on oeis.org

0, 1, 2, 4, 6, 8, 12, 14, 16, 20, 24, 26, 28, 30, 32, 40, 48, 50, 52, 56, 58, 60, 62, 64, 72, 80, 84, 96, 98, 100, 104, 106, 108, 112, 114, 116, 118, 120, 122, 124, 126, 128, 144, 160, 164, 168, 192, 194, 196, 200, 202, 208, 210, 212, 216, 218, 224, 226, 228
Offset: 1

Views

Author

Robert Israel, Aug 05 2016

Keywords

Comments

0, and terms of A065609 that are not in A121016.
Number of terms with d binary digits is A001037(d).
Take the binary representation of a(n), reverse it, add 1 to each digit. The result is the decimal representation of A102659(n).
From Gus Wiseman, Apr 19 2020: (Start)
Also numbers k such that the k-th composition in standard order (row k of A066099) is a Lyndon word. For example, the sequence of all Lyndon words begins:
0: () 52: (1,2,3) 118: (1,1,2,1,2)
1: (1) 56: (1,1,4) 120: (1,1,1,4)
2: (2) 58: (1,1,2,2) 122: (1,1,1,2,2)
4: (3) 60: (1,1,1,3) 124: (1,1,1,1,3)
6: (1,2) 62: (1,1,1,1,2) 126: (1,1,1,1,1,2)
8: (4) 64: (7) 128: (8)
12: (1,3) 72: (3,4) 144: (3,5)
14: (1,1,2) 80: (2,5) 160: (2,6)
16: (5) 84: (2,2,3) 164: (2,3,3)
20: (2,3) 96: (1,6) 168: (2,2,4)
24: (1,4) 98: (1,4,2) 192: (1,7)
26: (1,2,2) 100: (1,3,3) 194: (1,5,2)
28: (1,1,3) 104: (1,2,4) 196: (1,4,3)
30: (1,1,1,2) 106: (1,2,2,2) 200: (1,3,4)
32: (6) 108: (1,2,1,3) 202: (1,3,2,2)
40: (2,4) 112: (1,1,5) 208: (1,2,5)
48: (1,5) 114: (1,1,3,2) 210: (1,2,3,2)
50: (1,3,2) 116: (1,1,2,3) 212: (1,2,2,3)
(End)

Examples

			6 is in the sequence because its binary representation 110 is greater than all the rotations 011 and 101.
10 is not in the sequence because its binary representation 1010 is unchanged under rotation by 2 places.
From _Gus Wiseman_, Oct 31 2019: (Start)
The sequence of terms together with their binary expansions and binary indices begins:
    1:       1 ~ {1}
    2:      10 ~ {2}
    4:     100 ~ {3}
    6:     110 ~ {2,3}
    8:    1000 ~ {4}
   12:    1100 ~ {3,4}
   14:    1110 ~ {2,3,4}
   16:   10000 ~ {5}
   20:   10100 ~ {3,5}
   24:   11000 ~ {4,5}
   26:   11010 ~ {2,4,5}
   28:   11100 ~ {3,4,5}
   30:   11110 ~ {2,3,4,5}
   32:  100000 ~ {6}
   40:  101000 ~ {4,6}
   48:  110000 ~ {5,6}
   50:  110010 ~ {2,5,6}
   52:  110100 ~ {3,5,6}
   56:  111000 ~ {4,5,6}
   58:  111010 ~ {2,4,5,6}
(End)
		

Crossrefs

A similar concept is A328596.
Numbers whose binary expansion is aperiodic are A328594.
Numbers whose reversed binary expansion is a necklace are A328595.
Binary necklaces are A000031.
Binary Lyndon words are A001037.
Lyndon compositions are A059966.
Length of Lyndon factorization of binary expansion is A211100.
Length of co-Lyndon factorization of binary expansion is A329312.
Length of Lyndon factorization of reversed binary expansion is A329313.
Length of co-Lyndon factorization of reversed binary expansion is A329326.
All of the following pertain to compositions in standard order (A066099):
- Length is A000120.
- Necklaces are A065609.
- Sum is A070939.
- Rotational symmetries are counted by A138904.
- Strict compositions are A233564.
- Constant compositions are A272919.
- Lyndon compositions are A275692 (this sequence).
- Co-Lyndon compositions are A326774.
- Rotational period is A333632.
- Co-necklaces are A333764.
- Co-Lyndon factorizations are counted by A333765.
- Lyndon factorizations are counted by A333940.
- Reversed necklaces are A333943.

Programs

  • Maple
    filter:= proc(n) local L, k;
      L:= convert(convert(n,binary),string);
      for k from 1 to length(L)-1 do
        if lexorder(L,StringTools:-Rotate(L,k)) then return false fi;
      od;
      true
    end proc:
    select(filter, [$0..1000]);
  • Mathematica
    filterQ[n_] := Module[{bits, rr}, bits = IntegerDigits[n, 2]; rr = NestList[RotateRight, bits, Length[bits]-1] // Rest; AllTrue[rr, FromDigits[#, 2] < n&]];
    Select[Range[0, 1000], filterQ] (* Jean-François Alcover, Apr 29 2019 *)
  • Python
    def ok(n):
        b = bin(n)[2:]
        return all(b[i:] + b[:i] < b for i in range(1, len(b)))
    print([k for k in range(230) if ok(k)]) # Michael S. Branicky, May 26 2022

A102659 List of Lyndon words on {1,2} sorted first by length and then lexicographically.

Original entry on oeis.org

1, 2, 12, 112, 122, 1112, 1122, 1222, 11112, 11122, 11212, 11222, 12122, 12222, 111112, 111122, 111212, 111222, 112122, 112212, 112222, 121222, 122222, 1111112, 1111122, 1111212, 1111222, 1112112, 1112122, 1112212, 1112222, 1121122
Offset: 1

Views

Author

N. J. A. Sloane, Feb 03 2005

Keywords

Comments

A Lyndon word is primitive (not a power of another word) and is earlier in lexicographic order than any of its cyclic shifts.

Crossrefs

The "co" version is A329318.
A triangular version is A296657.
A sequence listing all Lyndon compositions is A294859.
Numbers whose binary expansion is Lyndon are A328596.
Length of the Lyndon factorization of the binary expansion is A211100.

Programs

  • Haskell
    cf. link.
    
  • Mathematica
    lynQ[q_]:=Array[Union[{q,RotateRight[q,#]}]=={q,RotateRight[q,#]}&,Length[q]-1,1,And];
    Join@@Table[FromDigits/@Select[Tuples[{1,2},n],lynQ],{n,5}] (* Gus Wiseman, Nov 14 2019 *)
  • PARI
    is_A102659(n)={ vecsort(d=digits(n))!=d&&for(i=1,#d-1, n>[1,10^(#d-i)]*divrem(n,10^i)&&return); fordiv(#d,L,L<#d && d==concat(Col(vector(#d/L,i,1)~*vecextract(d,2^L-1))~)&&return); !setminus(Set(d),[1,2])} \\ The last check is the least expensive one, but not useful if we test only numbers with digits {1,2}.
    for(n=1,6,p=vector(n,i,10^(n-i))~;forvec(d=vector(n,i,[1,2]),is_A102659(m=d*p)&&print1(m","))) \\ One could use is_A102660 instead of is_A102659 here. - M. F. Hasler, Mar 08 2014

Formula

A102659 = A102660 intersect A007931 = A213969 intersect A239016. - M. F. Hasler, Mar 10 2014

Extensions

More terms from Franklin T. Adams-Watters, Dec 14 2006
Definition improved by Reinhard Zumkeller, Mar 23 2012

A329312 Length of the co-Lyndon factorization of the binary expansion of n.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Nov 10 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).
Also the length of the Lyndon factorization of the inverted binary expansion of n, where the inverted digits are 1 minus the binary digits.

Examples

			The binary indices of 1..20 together with their co-Lyndon factorizations are:
   1:     (1) = (1)
   2:    (10) = (10)
   3:    (11) = (1)(1)
   4:   (100) = (100)
   5:   (101) = (10)(1)
   6:   (110) = (110)
   7:   (111) = (1)(1)(1)
   8:  (1000) = (1000)
   9:  (1001) = (100)(1)
  10:  (1010) = (10)(10)
  11:  (1011) = (10)(1)(1)
  12:  (1100) = (1100)
  13:  (1101) = (110)(1)
  14:  (1110) = (1110)
  15:  (1111) = (1)(1)(1)(1)
  16: (10000) = (10000)
  17: (10001) = (1000)(1)
  18: (10010) = (100)(10)
  19: (10011) = (100)(1)(1)
  20: (10100) = (10100)
		

Crossrefs

The non-"co" version is A211100.
Positions of 1's are A275692.
The reversed version is A329326.

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[IntegerDigits[n,2]]],{n,100}]

A329313 Length of the Lyndon factorization of the reversed binary expansion of n.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Nov 11 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. 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).

Examples

			The sequence of reversed binary expansions of the nonnegative integers together with their Lyndon factorizations begins:
   0:      () = ()
   1:     (1) = (1)
   2:    (01) = (01)
   3:    (11) = (1)(1)
   4:   (001) = (001)
   5:   (101) = (1)(01)
   6:   (011) = (011)
   7:   (111) = (1)(1)(1)
   8:  (0001) = (0001)
   9:  (1001) = (1)(001)
  10:  (0101) = (01)(01)
  11:  (1101) = (1)(1)(01)
  12:  (0011) = (0011)
  13:  (1011) = (1)(011)
  14:  (0111) = (0111)
  15:  (1111) = (1)(1)(1)(1)
  16: (00001) = (00001)
  17: (10001) = (1)(0001)
  18: (01001) = (01)(001)
  19: (11001) = (1)(1)(001)
  20: (00101) = (00101)
		

Crossrefs

The non-reversed version is A211100.
Positions of 1's are A328596.
The "co" version is A329326.
Binary Lyndon words are counted by A001037 and ranked by A102659.
Numbers whose reversed binary expansion is a necklace are A328595.
Numbers whose reversed binary expansion is a aperiodic are A328594.
Length of the co-Lyndon factorization of the binary expansion is A329312.

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,#1]]&]]]];
    Table[If[n==0,0,Length[lynfac[Reverse[IntegerDigits[n,2]]]]],{n,0,30}]

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

A326774 For any number m, let m* be the bi-infinite string obtained by repetition of the binary representation of m; this sequence lists the numbers n such that for any k < n, n* does not equal k* up to a shift.

Original entry on oeis.org

0, 1, 2, 4, 5, 8, 9, 11, 16, 17, 18, 19, 21, 23, 32, 33, 34, 35, 37, 38, 39, 43, 47, 64, 65, 66, 67, 68, 69, 70, 71, 73, 74, 75, 77, 78, 79, 85, 87, 91, 95, 128, 129, 130, 131, 132, 133, 134, 135, 137, 138, 139, 140, 141, 142, 143, 146, 147, 149, 150, 151, 154
Offset: 0

Views

Author

Rémy Sigrist, Jul 27 2019

Keywords

Comments

This sequence contains every power of 2.
No term belongs to A121016.
Every terms belongs to A004761.
For any k > 0, there are A001037(k) terms with binary length k.
From Gus Wiseman, Apr 19 2020: (Start)
Also numbers k such that the k-th composition in standard order (row k of A066099) is a co-Lyndon word (regular Lyndon words being A275692). For example, the sequence of all co-Lyndon words begins:
0: () 37: (3,2,1) 79: (3,1,1,1,1)
1: (1) 38: (3,1,2) 85: (2,2,2,1)
2: (2) 39: (3,1,1,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) 70: (4,1,2) 134: (5,1,2)
21: (2,2,1) 71: (4,1,1,1) 135: (5,1,1,1)
23: (2,1,1,1) 73: (3,3,1) 137: (4,3,1)
32: (6) 74: (3,2,2) 138: (4,2,2)
33: (5,1) 75: (3,2,1,1) 139: (4,2,1,1)
34: (4,2) 77: (3,1,2,1) 140: (4,1,3)
35: (4,1,1) 78: (3,1,1,2) 141: (4,1,2,1)
(End)

Examples

			3* = ...11... equals 1* = ...1..., so 3 is not a term.
6* = ...110... equals up to a shift 5* = ...101..., so 6 is not a term.
11* = ...1011... only equals up to a shift 13* = ...1101... and 14* = ...1110..., so 11 is a term.
		

Crossrefs

Necklace compositions are counted by A008965.
Lyndon compositions are counted by A059966.
Length of Lyndon factorization of binary expansion is A211100.
Numbers whose reversed binary expansion is a necklace are A328595.
Length of co-Lyndon factorization of binary expansion is A329312.
Length of Lyndon factorization of reversed binary expansion is A329313.
Length of co-Lyndon factorization of reversed binary expansion is A329326.
All of the following pertain to compositions in standard order (A066099):
- Length is A000120.
- Necklaces are A065609.
- Sum is A070939.
- Runs are counted by A124767.
- Rotational symmetries are counted by A138904.
- Strict compositions are A233564.
- Constant compositions are A272919.
- Lyndon compositions are A275692.
- Co-Lyndon compositions are A326774 (this sequence).
- Aperiodic compositions are A328594.
- Reversed co-necklaces are A328595.
- Rotational period is A333632.
- Co-necklaces are A333764.
- Co-Lyndon factorizations are counted by A333765.
- Lyndon factorizations are counted by A333940.
- Reversed necklaces are A333943.
- Length of co-Lyndon factorization is A334029.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    colynQ[q_]:=Length[q]==0||Array[Union[{RotateRight[q,#],q}]=={RotateRight[q,#],q}&,Length[q]-1,1,And];
    Select[Range[0,100],colynQ[stc[#]]&] (* Gus Wiseman, Apr 19 2020 *)
  • PARI
    See Links section.

A333764 Numbers k such that the k-th composition in standard order is a co-necklace.

Original entry on oeis.org

1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 15, 16, 17, 18, 19, 21, 23, 31, 32, 33, 34, 35, 36, 37, 38, 39, 42, 43, 45, 47, 63, 64, 65, 66, 67, 68, 69, 70, 71, 73, 74, 75, 77, 78, 79, 85, 87, 91, 95, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140
Offset: 1

Views

Author

Gus Wiseman, Apr 12 2020

Keywords

Comments

A co-necklace is a finite sequence that is lexicographically greater than or equal to any cyclic rotation.
A composition of n is a finite sequence of positive integers summing to n. The k-th composition in standard order (row k of 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 together with the corresponding co-necklaces begins:
    1: (1)             32: (6)               69: (4,2,1)
    2: (2)             33: (5,1)             70: (4,1,2)
    3: (1,1)           34: (4,2)             71: (4,1,1,1)
    4: (3)             35: (4,1,1)           73: (3,3,1)
    5: (2,1)           36: (3,3)             74: (3,2,2)
    7: (1,1,1)         37: (3,2,1)           75: (3,2,1,1)
    8: (4)             38: (3,1,2)           77: (3,1,2,1)
    9: (3,1)           39: (3,1,1,1)         78: (3,1,1,2)
   10: (2,2)           42: (2,2,2)           79: (3,1,1,1,1)
   11: (2,1,1)         43: (2,2,1,1)         85: (2,2,2,1)
   15: (1,1,1,1)       45: (2,1,2,1)         87: (2,2,1,1,1)
   16: (5)             47: (2,1,1,1,1)       91: (2,1,2,1,1)
   17: (4,1)           63: (1,1,1,1,1,1)     95: (2,1,1,1,1,1)
   18: (3,2)           64: (7)              127: (1,1,1,1,1,1,1)
   19: (3,1,1)         65: (6,1)            128: (8)
   21: (2,2,1)         66: (5,2)            129: (7,1)
   23: (2,1,1,1)       67: (5,1,1)          130: (6,2)
   31: (1,1,1,1,1)     68: (4,3)            131: (6,1,1)
		

Crossrefs

The non-"co" version is A065609.
The reversed version is A328595.
Binary necklaces are A000031.
Necklace compositions are A008965.
Necklaces covering an initial interval are A019536.
Numbers whose prime signature is a necklace are A329138.
Length of co-Lyndon factorization of binary expansion is A329312.
Length of Lyndon factorization of reversed binary expansion is A329313.
All of the following pertain to compositions in standard order (A066099):
- Length is A000120.
- Sum is A070939.
- Runs are counted by A124767.
- Rotational symmetries are counted by A138904.
- Strict compositions are A233564.
- Constant compositions are A272919.
- Lyndon compositions are A275692.
- Co-Lyndon compositions are A326774.
- Aperiodic compositions are A328594.
- Length of Lyndon factorization is A329312.
- Rotational period is A333632.
- Reversed necklaces are A333943.

Programs

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

A329326 Length of the co-Lyndon factorization of the reversed binary expansion of n.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Nov 11 2019

Keywords

Comments

First differs from A211100 at a(77) = 3, A211100(77) = 2. The reversed binary expansion of 77 is (1011001), with co-Lyndon factorization (10)(1100)(1), while the binary expansion is (1001101), with Lyndon factorization of (1)(001101).
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 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 positive integer together with their co-Lyndon factorizations begins:
   1:     (1) = (1)
   2:    (01) = (0)(1)
   3:    (11) = (1)(1)
   4:   (001) = (0)(0)(1)
   5:   (101) = (10)(1)
   6:   (011) = (0)(1)(1)
   7:   (111) = (1)(1)(1)
   8:  (0001) = (0)(0)(0)(1)
   9:  (1001) = (100)(1)
  10:  (0101) = (0)(10)(1)
  11:  (1101) = (110)(1)
  12:  (0011) = (0)(0)(1)(1)
  13:  (1011) = (10)(1)(1)
  14:  (0111) = (0)(1)(1)(1)
  15:  (1111) = (1)(1)(1)(1)
  16: (00001) = (0)(0)(0)(0)(1)
  17: (10001) = (1000)(1)
  18: (01001) = (0)(100)(1)
  19: (11001) = (1100)(1)
  20: (00101) = (0)(0)(10)(1)
		

Crossrefs

The non-"co" version is A211100.
Positions of 2's are A329357.
Numbers whose binary expansion is co-Lyndon are A275692.
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,#]]&]]];
    Table[Length[colynfac[Reverse[IntegerDigits[n,2]]]],{n,100}]

A333632 Rotational period of the k-th composition in standard order; a(0) = 0.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Apr 12 2020

Keywords

Comments

A composition of n is a finite sequence of positive integers summing to n. 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 a(299) = 5 rotations:
  (1,1,3,2,2)
  (1,3,2,2,1)
  (3,2,2,1,1)
  (2,2,1,1,3)
  (2,1,1,3,2)
The a(9933) = 4 rotations:
  (1,2,1,3,1,2,1,3)
  (1,3,1,2,1,3,1,2)
  (2,1,3,1,2,1,3,1)
  (3,1,2,1,3,1,2,1)
		

Crossrefs

Aperiodic compositions are counted by A000740.
Aperiodic binary words are counted by A027375.
The orderless period of prime indices is A052409.
Numbers whose binary expansion is periodic are A121016.
Periodic compositions are counted by A178472.
The version for binary expansion is A302291.
Numbers whose prime signature is aperiodic are A329139.
Compositions by number of distinct rotations are A333941.
All of the following pertain to compositions in standard order (A066099):
- Length is A000120.
- Necklaces are A065609.
- Sum is A070939.
- Equal runs are counted by A124767.
- Rotational symmetries are counted by A138904.
- Strict compositions are A233564.
- Constant compositions are A272919.
- Lyndon compositions are A275692.
- Co-Lyndon compositions are A326774.
- Aperiodic compositions are A328594.
- Rotational period is A333632 (this sequence).
- Co-necklaces are A333764.
- Reversed necklaces are A333943.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Table[Length[Union[Array[RotateRight[stc[n],#]&,DigitCount[n,2,1]]]],{n,0,100}]

Formula

a(n) = A000120(n)/A138904(n) = A302291(n) - A023416(n)/A138904(n).

A329318 List of co-Lyndon words on {1,2} sorted first by length and then lexicographically.

Original entry on oeis.org

1, 2, 21, 211, 221, 2111, 2211, 2221, 21111, 21211, 22111, 22121, 22211, 22221, 211111, 212111, 221111, 221121, 221211, 222111, 222121, 222211, 222221, 2111111, 2112111, 2121111, 2121211, 2211111, 2211121, 2211211, 2212111, 2212121, 2212211, 2221111, 2221121
Offset: 1

Views

Author

Gus Wiseman, Nov 11 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).

Crossrefs

The non-"co" version is A102659.
Numbers whose binary expansion is co-Lyndon are A275692.
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];
    Join@@Table[FromDigits/@Select[Tuples[{1,2},n],colynQ],{n,5}]
Showing 1-10 of 47 results. Next