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.

A329141 Number of Lyndon compositions of n that are not weakly increasing.

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 4, 11, 28, 60, 131, 263, 530, 1029, 2009, 3853, 7414, 14152, 27105, 51755, 99069, 189558, 363468, 697302, 1340220, 2578362, 4968001, 9582682, 18508226, 35784670, 69266825, 134207336, 260290846, 505274108, 981691926
Offset: 1

Views

Author

Gus Wiseman, Nov 10 2019

Keywords

Comments

A Lyndon composition of n is a finite sequence of positive integers summing to n that is lexicographically strictly less than all of its cyclic rotations.

Examples

			The a(6) = 1 through a(8) = 11 compositions:
  (132)  (142)    (143)
         (1132)   (152)
         (1213)   (1142)
         (11212)  (1214)
                  (1232)
                  (1322)
                  (11132)
                  (11213)
                  (11312)
                  (12122)
                  (111212)
		

Crossrefs

Lyndon compositions are A059966.
Lyndon compositions that are weakly increasing are A167934.
Binary Lyndon words are A001037.
Necklace compositions are A008965.

Programs

  • Mathematica
    neckQ[q_]:=Array[OrderedQ[{q,RotateRight[q,#]}]&,Length[q]-1,1,And];
    aperQ[q_]:=Array[RotateRight[q,#1]&,Length[q],1,UnsameQ];
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],!OrderedQ[#]&&neckQ[#]&&aperQ[#]&]],{n,10}]

Formula

a(n) = A059966(n) - A167934(n).

A299026 Number of compositions of n whose standard factorization into Lyndon words has all weakly increasing factors.

Original entry on oeis.org

1, 2, 4, 8, 16, 31, 59, 111, 205, 378, 685, 1238, 2213, 3940, 6955, 12221, 21333, 37074, 64073, 110267, 188877, 322244, 547522, 926903, 1563370, 2628008, 4402927, 7353656, 12244434, 20329271, 33657560, 55574996, 91525882, 150356718, 246403694, 402861907
Offset: 1

Views

Author

Gus Wiseman, Feb 01 2018

Keywords

Examples

			The 2^6 - a(7) = 5 compositions of 7 whose Lyndon prime factors are not all weakly increasing: (11212), (1132), (1213), (1321), (142).
		

Crossrefs

Programs

  • Mathematica
    nn=50;
    ser=Product[1/(1-x^n)^(PartitionsP[n]-DivisorSigma[0,n]+1),{n,nn}];
    Table[SeriesCoefficient[ser,{x,0,n}],{n,nn}]
  • PARI
    EulerT(v)={Vec(exp(x*Ser(dirmul(v,vector(#v,n,1/n))))-1, -#v)}
    seq(n)={EulerT(vector(n, n, numbpart(n) - numdiv(n) + 1))} \\ Andrew Howroyd, Dec 01 2018

Formula

Euler transform of A167934.

A299027 Number of compositions of n whose standard factorization into Lyndon words has all distinct weakly increasing factors.

Original entry on oeis.org

1, 1, 3, 5, 11, 20, 38, 69, 125, 225, 400, 708, 1244, 2176, 3779, 6532, 11229, 19223, 32745, 55555, 93875, 158025, 265038, 443009, 738026, 1225649, 2029305, 3350167, 5515384, 9055678, 14830076, 24226115, 39480306, 64190026, 104130753, 168556588, 272268482
Offset: 1

Views

Author

Gus Wiseman, Feb 01 2018

Keywords

Examples

			The a(5) = 11 compositions:
      (5) = (5)
     (41) = (4)*(1)
     (14) = (14)
     (32) = (3)*(2)
     (23) = (23)
    (131) = (13)*(1)
    (113) = (113)
    (212) = (2)*(12)
    (122) = (122)
   (1121) = (112)*(1)
   (1112) = (1112)
Not included:
    (311) = (3)*(1)*(1)
    (221) = (2)*(2)*(1)
   (2111) = (2)*(1)*(1)*(1)
   (1211) = (12)*(1)*(1)
  (11111) = (1)*(1)*(1)*(1)*(1)
		

Crossrefs

Programs

  • Mathematica
    nn=50;
    ser=Product[(1+x^n)^(PartitionsP[n]-DivisorSigma[0,n]+1),{n,nn}];
    Table[SeriesCoefficient[ser,{x,0,n}],{n,nn}]
  • PARI
    WeighT(v)={Vec(exp(x*Ser(dirmul(v, vector(#v,n,(-1)^(n-1)/n))))-1,-#v)}
    seq(n)={WeighT(vector(n, n, numbpart(n) - numdiv(n) + 1))} \\ Andrew Howroyd, Dec 01 2018

Formula

Weigh transform of A167934.

A167928 Number of partitions of n that do not contain 1 as a part and whose parts are not the same divisor of n.

Original entry on oeis.org

1, 0, 0, 0, 0, 1, 1, 3, 4, 6, 9, 13, 16, 23, 31, 38, 51, 65, 83, 104, 132, 162, 207, 252, 313, 381, 475, 571, 703, 846, 1032, 1237, 1502, 1791, 2164, 2570, 3086, 3659, 4375, 5167, 6146, 7244, 8584, 10086, 11909, 13954, 16421, 19195, 22510, 26250, 30696, 35714
Offset: 0

Views

Author

Omar E. Pol, Nov 17 2009

Keywords

Comments

Note that these partitions are located in the head of the last section of the set of partitions of n (see the shell model of partitions, here).

Examples

			The partitions of 6 are:
6 ....................... All parts are the same divisor of n.
5 + 1 ................... Contains 1 as a part.
4 + 2 ................... All parts are not the same divisor of n. <------(1)
4 + 1 + 1 ............... Contains 1 as a part.
3 + 3 ................... All parts are the same divisor of n.
3 + 2 + 1 ............... Contains 1 as a part.
3 + 1 + 1 + 1 ........... Contains 1 as a part.
2 + 2 + 2 ............... All parts are the same divisor of n.
2 + 2 + 1 + 1 ........... Contains 1 as a part.
2 + 1 + 1 + 1 + 1 ....... Contains 1 as a part.
1 + 1 + 1 + 1 + 1 + 1 ... Contains 1 as a part.
Then a(6) = 1.
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i, t) option remember;
          `if`(n=0, `if`(t<>1, 1, 0), `if`(i<2, 0,
          add(b(n-i*j, i-1, `if`(j=0, t, max(0, t-1))), j=0..n/i)))
        end:
    a:= n-> b(n, n, 2):
    seq(a(n), n=0..60);  # Alois P. Heinz, May 24 2013
  • Mathematica
    Prepend[Array[ n \[Function] Length@Select[IntegerPartitions[n, All, Range[2, n - 1]], Length[Union[ # ]] > 1 &], 40], 1] (* J. Mulder (jasper.mulder(AT)planet.nl), Jan 25 2010 *)
    b[n_, i_, t_] := b[n, i, t] = If[n == 0, If[t != 1, 1, 0], If[i < 2, 0, Sum[b[n - i*j, i - 1, If[j == 0, t, Max[0, t - 1]]], {j, 0, n/i}]]]; a[n_] := b[n, n, 2]; Table[a[n], {n, 0, 60}] (* Jean-François Alcover, Aug 29 2016, after Alois P. Heinz *)

Formula

a(n) = A002865(n) - A032741(n).

Extensions

More terms from J. Mulder (jasper.mulder(AT)planet.nl), Jan 25 2010
More terms from Alois P. Heinz, May 24 2013

A298947 Number of integer partitions y of n such that exactly one permutation of y is a Lyndon word.

Original entry on oeis.org

1, 1, 2, 3, 6, 7, 11, 12, 15, 19, 22, 22, 29, 32, 32, 38, 42, 44, 49, 51, 54, 63, 63, 64, 71, 79, 76, 84, 87, 90, 96, 101, 101, 113, 108, 115, 122, 131, 125, 134, 138, 144, 147, 155, 150, 169, 163, 168, 173, 185, 180, 194, 191, 200, 198, 211, 209, 227, 218, 224, 231, 246
Offset: 1

Views

Author

Gus Wiseman, Jan 30 2018

Keywords

Examples

			The a(6) = 7 partitions are (6), (51), (42), (411), (3111), (2211), (21111). This list does not include (321) because there are two possible permutations that are Lyndon words, namely (123) and (132). The list does not include (33), (222), or (111111) because no permutation of these is a Lyndon word.
		

Crossrefs

Programs

  • Maple
    with(combinat): with(numtheory):
    g:= l-> (n-> `if`(n=0, 1, add(mobius(j)*multinomial(n/j,
            (l/j)[]), j=divisors(igcd(l[])))/n))(add(i, i=l)):
    b:= (n, i, l)-> `if`(n=0 or i=1, `if`(g([l[], n])=1, 1, 0),
                     add(b(n-i*j, i-1, [l[], j]), j=0..n/i)):
    a:= n-> b(n$2, []):
    seq(a(n), n=1..30);  # Alois P. Heinz, Feb 09 2018
  • Mathematica
    LyndonQ[q_]:=Array[OrderedQ[{q,RotateRight[q,#]}]&,Length[q]-1,1,And]&&Array[RotateRight[q,#]&,Length[q],1,UnsameQ];
    Table[Length[Select[IntegerPartitions[n],Length[Select[Permutations[#],LyndonQ]]===1&]],{n,20}]
    (* Second program: *)
    multinomial[n_, k_List] := n!/Times @@ (k!);
    g[l_List] := With[{n = Total[l]}, If[n == 0, 1, Sum[MoebiusMu[j]*multinomial[n/j, l/j], {j, Divisors[GCD @@ l]}]/n]];
    b[n_, i_, l_List] := If[n == 0 || i == 1, If[g[Append[l, n]] == 1, 1, 0], Sum[b[n - i*j, i - 1, Append[l, j]], {j, 0, n/i}]];
    a[n_] := b[n, n, {}];
    Array[a, 30] (* Jean-François Alcover, May 20 2021, after Alois P. Heinz *)

Extensions

a(23)-a(62) from Alois P. Heinz, Feb 09 2018
Showing 1-5 of 5 results.