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-20 of 144 results. Next

A351013 Number of integer compositions of n with all distinct runs.

Original entry on oeis.org

1, 1, 2, 4, 7, 14, 26, 48, 88, 161, 294, 512, 970, 1634, 2954, 5156, 9119, 15618, 27354, 46674, 80130, 138078, 232286, 394966, 665552, 1123231, 1869714, 3146410, 5186556, 8620936, 14324366, 23529274, 38564554, 63246744, 103578914, 167860584, 274465845
Offset: 0

Views

Author

Gus Wiseman, Feb 09 2022

Keywords

Examples

			The a(1) = 1 through a(5) = 14 compositions:
  (1)  (2)    (3)      (4)        (5)
       (1,1)  (1,2)    (1,3)      (1,4)
              (2,1)    (2,2)      (2,3)
              (1,1,1)  (3,1)      (3,2)
                       (1,1,2)    (4,1)
                       (2,1,1)    (1,1,3)
                       (1,1,1,1)  (1,2,2)
                                  (2,2,1)
                                  (3,1,1)
                                  (1,1,1,2)
                                  (1,1,2,1)
                                  (1,2,1,1)
                                  (2,1,1,1)
                                  (1,1,1,1,1)
For example, the composition c = (3,1,1,1,1,2,1,1,3,4,1,1) has runs (3), (1,1,1,1), (2), (1,1), (3), (4), (1,1), and since (3) and (1,1) both appear twice, c is not counted under a(20).
		

Crossrefs

The version for run-lengths instead of runs is A329739, normal A329740.
These compositions are ranked by A351290, complement A351291.
A000005 counts constant compositions, ranked by A272919.
A005811 counts runs in binary expansion.
A011782 counts integer compositions.
A059966 counts binary Lyndon compositions, necklaces A008965, aperiodic A000740.
A116608 counts compositions by number of distinct parts.
A238130 and A238279 count compositions by number of runs.
A242882 counts compositions with distinct multiplicities.
A297770 counts distinct runs in binary expansion.
A325545 counts compositions with distinct differences.
A329744 counts compositions by runs-resistance.
A351014 counts distinct runs in standard compositions.
Counting words with all distinct runs:
- A351016 = binary words, for run-lengths A351017.
- A351018 = binary expansions, for run-lengths A032020, ranked by A175413.
- A351200 = patterns, for run-lengths A351292.
- A351202 = permutations of prime factors.

Programs

  • Mathematica
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],UnsameQ@@Split[#]&]],{n,0,10}]
  • PARI
    \\ here LahI is A111596 as row polynomials.
    LahI(n,y) = {sum(k=1, n, y^k*(-1)^(n-k)*(n!/k!)*binomial(n-1, k-1))}
    S(n) = {my(p=prod(k=1, n, 1 + y*x^k + O(x*x^n))); 1 + sum(i=1, (sqrtint(8*n+1)-1)\2, polcoef(p,i,y)*LahI(i,y))}
    seq(n)={my(q=S(n)); [subst(serlaplace(p),y,1) | p<-Vec(prod(k=1, n, subst(q + O(x*x^(n\k)), x, x^k)))]} \\ Andrew Howroyd, Feb 12 2022

Extensions

Terms a(26) and beyond from Andrew Howroyd, Feb 12 2022

A328595 Numbers whose reversed binary expansion is a necklace.

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, 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, 144, 152, 160, 164, 168, 170, 172, 176, 180
Offset: 1

Views

Author

Gus Wiseman, Oct 22 2019

Keywords

Comments

A necklace is a finite sequence that is lexicographically minimal among all of its cyclic rotations.

Examples

			The sequence of terms together with their binary expansions and binary indices begins:
   1:      1 ~ {1}
   2:     10 ~ {2}
   3:     11 ~ {1,2}
   4:    100 ~ {3}
   6:    110 ~ {2,3}
   7:    111 ~ {1,2,3}
   8:   1000 ~ {4}
  10:   1010 ~ {2,4}
  12:   1100 ~ {3,4}
  14:   1110 ~ {2,3,4}
  15:   1111 ~ {1,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}
  31:  11111 ~ {1,2,3,4,5}
  32: 100000 ~ {6}
  36: 100100 ~ {3,6}
		

Crossrefs

A similar concept is A065609.
The version with the most significant digit ignored is A328607.
Lyndon words are A328596.
Aperiodic words are A328594.
Binary necklaces are A000031.
Necklace compositions are A008965.

Programs

  • Mathematica
    neckQ[q_]:=Array[OrderedQ[{q,RotateRight[q,#]}]&,Length[q]-1,1,And];
    Select[Range[100],neckQ[Reverse[IntegerDigits[#,2]]]&]
  • Python
    from itertools import count, islice
    from sympy.utilities.iterables import necklaces
    def a_gen():
        for n in count(1):
            t = []
            for i in necklaces(n,2):
                if sum(i)>0:
                    t.append(sum(2**j for j in range(len(i)) if i[j] > 0))
            yield from sorted(t)
    A328595_list = list(islice(a_gen(), 100)) # John Tyler Rascoe, May 24 2024

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

A178472 Number of compositions (ordered partitions) of n where the gcd of the part sizes is not 1.

Original entry on oeis.org

0, 1, 1, 2, 1, 5, 1, 8, 4, 17, 1, 38, 1, 65, 19, 128, 1, 284, 1, 518, 67, 1025, 1, 2168, 16, 4097, 256, 8198, 1, 16907, 1, 32768, 1027, 65537, 79, 133088, 1, 262145, 4099, 524408, 1, 1056731, 1, 2097158, 16636, 4194305, 1, 8421248, 64, 16777712, 65539
Offset: 1

Views

Author

Keywords

Comments

Of course, all part sizes must be greater than 1; that condition alone gives the Fibonacci numbers, which is thus an upper bound.
Also the number of periodic compositions of n, where a sequence is periodic if its cyclic rotations are not all different. Also compositions with non-relatively prime run-lengths. - Gus Wiseman, Nov 10 2019

Examples

			For n=6, we have 5 compositions: <6>, <4,2>, <2,4>, <2,2,2>, and <3,3>.
From _Gus Wiseman_, Nov 10 2019: (Start)
The a(2) = 1 through a(9) = 4 non-relatively prime compositions:
  (2)  (3)  (4)    (5)  (6)      (7)  (8)        (9)
            (2,2)       (2,4)         (2,6)      (3,6)
                        (3,3)         (4,4)      (6,3)
                        (4,2)         (6,2)      (3,3,3)
                        (2,2,2)       (2,2,4)
                                      (2,4,2)
                                      (4,2,2)
                                      (2,2,2,2)
The a(2) = 1 through a(9) = 4 periodic compositions:
  11  111  22    11111  33      1111111  44        333
           1111         222              1313      121212
                        1212             2222      212121
                        2121             3131      111111111
                        111111           112112
                                         121121
                                         211211
                                         11111111
The a(2) = 1 through a(9) = 4 compositions with non-relatively prime run-lengths:
  11  111  22    11111  33      1111111  44        333
           1111         222              1133      111222
                        1122             2222      222111
                        2211             3311      111111111
                        111111           111122
                                         112211
                                         221111
                                         11111111
(End)
		

Crossrefs

Periodic binary words are A152061.

Programs

  • Maple
    A178472 := n -> (2^n - add(mobius(n/d)*2^d, d in divisors(n)))/2:
    seq(A178472(n), n=1..51); # Peter Luschny, Jan 21 2018
  • Mathematica
    Table[2^(n - 1) - DivisorSum[n, MoebiusMu[n/#]*2^(# - 1) &], {n, 51}] (* Michael De Vlieger, Jan 20 2018 *)
  • PARI
    vector(60,n,2^(n-1)-sumdiv(n,d,2^(d-1)*moebius(n/d)))
    
  • Python
    from sympy import mobius, divisors
    def A178472(n): return -sum(mobius(n//d)<Chai Wah Wu, Sep 21 2024

Formula

a(n) = Sum_{d|n & d
a(n) = 2^(n-1) - A000740(n).
a(n) = A152061(n)/2. - George Beck, Jan 20 2018
a(p) = 1 for p prime. - Chai Wah Wu, Sep 21 2024

Extensions

Ambiguous term a(0) removed by Max Alekseyev, Jan 02 2012

A334028 Number of distinct parts in the n-th composition in standard order.

Original entry on oeis.org

0, 1, 1, 1, 1, 2, 2, 1, 1, 2, 1, 2, 2, 2, 2, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 2, 2, 2, 1, 3, 3, 2, 2, 3, 1, 2, 3, 2, 2, 2, 2, 2, 3, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 2, 2, 2, 2, 3, 3, 2, 2, 2, 2, 3, 2, 3, 3, 2, 2, 3, 2, 3, 2, 2, 2
Offset: 0

Author

Gus Wiseman, Apr 18 2020

Keywords

Comments

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 77th composition is (3,1,2,1), so a(77) = 3.
		

Crossrefs

Number of distinct prime indices is A001221.
Positions of first appearances (offset 1) are A246534.
Positions of 1's are A272919.
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.
- Aperiodic compositions are A328594.
- Rotational period is A333632.
- Dealings are A333939.

Programs

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

A065609 Positive m such that when written in binary, no rotated value of m is greater than m.

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, 40, 42, 48, 50, 52, 54, 56, 58, 60, 62, 63, 64, 72, 80, 84, 96, 98, 100, 104, 106, 108, 112, 114, 116, 118, 120, 122, 124, 126, 127, 128, 136, 144, 160, 164, 168, 170, 192, 194, 196, 200, 202
Offset: 1

Author

Jonathan Ayres (jonathan.ayres(AT)btinternet.com), Nov 06 2001

Keywords

Comments

Rotated values of m are defined as the numbers which occur when m is shifted 1, 2, ... bits to the right with the last bits added to the front; e.g., the rotated values of 1011 are 1011, 1101, 1110 and 0111.
The number of k-bit binary numbers in this sequence is A008965. This gives the row lengths when the sequence is regarded as a table.
If m is in the sequence, then so is 2m. All odd terms are of the form 2^k - 1. - Ivan Neretin, Aug 04 2016
First differs from A328595 in lacking 44, with binary expansion {1, 0, 1, 1, 0, 0}, and 92, with binary expansion {1, 0, 1, 1, 1, 0, 0}. - Gus Wiseman, Oct 31 2019

Examples

			14 is included because 14 in binary is 1110. 1110 has the rotated values of 0111, 1011 and 1101 -- 7, 11 and 13 -- which are all smaller than 14.
		

Crossrefs

A similar concept is A328595.
The version with the most significant digit ignored is A328668 or A328607.
Numbers whose reversed binary expansion is a Lyndon word are A328596.
Numbers whose binary expansion is aperiodic are A328594.
Binary necklaces are A000031.
Necklace compositions are A008965.

Programs

  • Maple
    filter:= proc(n) local L, k;
      if n::odd then return evalb(n+1 = 2^ilog2(n+1)) fi;
      L:= convert(convert(n,binary),string);
      for k from 1 to length(L)-1 do
        if not lexorder(StringTools:-Rotate(L,k),L) then return false fi;
      od;
      true
    end proc:
    select(filter, [$1..1000]); # Robert Israel, Aug 05 2016
  • Mathematica
    Select[Range[200], # == Max[FromDigits[#, 2] & /@ NestList[RotateLeft, dg = IntegerDigits[#, 2], Length@dg]] &] (* Ivan Neretin, Aug 04 2016 *)
  • Python
    def ok(n):
        b = bin(n)[2:]
        return b > "0" and all(b[i:] + b[:i] <= b for i in range(1, len(b)))
    print([k for k in range(203) if ok(k)]) # Michael S. Branicky, May 26 2022

Extensions

Edited by Franklin T. Adams-Watters, Apr 09 2010

A069916 Number of log-concave compositions (ordered partitions) of n.

Original entry on oeis.org

1, 1, 2, 4, 6, 9, 14, 20, 26, 36, 47, 60, 80, 102, 127, 159, 194, 236, 291, 355, 425, 514, 611, 718, 856, 1009, 1182, 1381, 1605, 1861, 2156, 2496, 2873, 3299, 3778, 4301, 4902, 5574, 6325, 7176, 8116, 9152, 10317, 11610, 13028, 14611, 16354, 18259, 20365
Offset: 0

Author

Pontus von Brömssen, Apr 24 2002

Keywords

Comments

These are compositions with weakly decreasing first quotients, where the first quotients of a sequence are defined as if the sequence were an increasing divisor chain, so for example the first quotients of (6,3,1) are (1/2,1/3). - Gus Wiseman, Mar 16 2021

Examples

			Out of the 8 compositions of 4, only 2+1+1 and 1+1+2 are not log-concave, so a(4)=6.
From _Gus Wiseman_, Mar 15 2021: (Start)
The a(1) = 1 through a(6) = 14 compositions:
  (1)  (2)   (3)    (4)     (5)      (6)
       (11)  (12)   (13)    (14)     (15)
             (21)   (22)    (23)     (24)
             (111)  (31)    (32)     (33)
                    (121)   (41)     (42)
                    (1111)  (122)    (51)
                            (131)    (123)
                            (221)    (132)
                            (11111)  (141)
                                     (222)
                                     (231)
                                     (321)
                                     (1221)
                                     (111111)
(End)
		

Crossrefs

The version for differences instead of quotients is A070211.
A000005 counts constant compositions.
A000009 counts strictly increasing (or strictly decreasing) compositions.
A000041 counts weakly increasing (or weakly decreasing) compositions.
A001055 counts factorizations.
A002843 counts compositions with adjacent parts x <= 2y.
A003238 counts chains of divisors summing to n-1, with strict case A122651.
A003242 counts anti-run compositions.
A074206 counts ordered factorizations.
A167865 counts strict chains of divisors summing to n.

Programs

  • Mathematica
    (* This program is not suitable for computing a large number of terms *)
    compos[n_] := Permutations /@ IntegerPartitions[n] // Flatten[#, 1]&;
    logConcaveQ[p_] := And @@ Table[p[[i]]^2 >= p[[i-1]]*p[[i+1]], {i, 2, Length[p]-1}]; a[n_] := Count[compos[n], p_?logConcaveQ]; Table[an = a[n]; Print["a(", n, ") = ", an]; a[n], {n, 0, 25}] (* Jean-François Alcover, Feb 29 2016 *)
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],GreaterEqual@@Divide@@@Reverse/@Partition[#,2,1]&]],{n,0,15}] (* Gus Wiseman, Mar 15 2021 *)
  • Sage
    def A069916(n) : return sum(all(p[i]^2 >= p[i-1] * p[i+1] for i in range(1, len(p)-1)) for p in Compositions(n)) # Eric M. Schmidt, Sep 29 2013

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

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

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

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.
Previous Showing 11-20 of 144 results. Next