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

A060016 Triangle T(n,k) = number of partitions of n into k distinct parts, 1 <= k <= n.

Original entry on oeis.org

1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 2, 0, 0, 0, 1, 2, 1, 0, 0, 0, 1, 3, 1, 0, 0, 0, 0, 1, 3, 2, 0, 0, 0, 0, 0, 1, 4, 3, 0, 0, 0, 0, 0, 0, 1, 4, 4, 1, 0, 0, 0, 0, 0, 0, 1, 5, 5, 1, 0, 0, 0, 0, 0, 0, 0, 1, 5, 7, 2, 0, 0, 0, 0, 0, 0, 0, 0, 1, 6, 8, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 6, 10, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 1

Views

Author

Keywords

Comments

Also number of partitions of n-k(k+1)/2 into at most k parts (not necessarily distinct).
A025147(n) = Sum_{k=2..floor((n+2)/2)} a(n-k+1, k-1). - Reinhard Zumkeller, Nov 04 2007

Examples

			Triangle starts
[ 1]  1,
[ 2]  1, 0,
[ 3]  1, 1, 0,
[ 4]  1, 1, 0, 0,
[ 5]  1, 2, 0, 0, 0,
[ 6]  1, 2, 1, 0, 0, 0,
[ 7]  1, 3, 1, 0, 0, 0, 0,
[ 8]  1, 3, 2, 0, 0, 0, 0, 0,
[ 9]  1, 4, 3, 0, 0, 0, 0, 0, 0,
[10]  1, 4, 4, 1, 0, 0, 0, 0, 0, 0,
[11]  1, 5, 5, 1, 0, 0, 0, 0, 0, 0, 0,
[12]  1, 5, 7, 2, 0, 0, 0, 0, 0, 0, 0, 0,
[13]  1, 6, 8, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0,
[14]  1, 6, 10, 5, 0, 0, 0, 0, 0, 0, 0, 0, ...
T(8,3)=2 since 8 can be written in 2 ways as the sum of 3 distinct positive integers: 5+2+1 and 4+3+1.
		

References

  • M. Abramowitz and I. A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards Applied Math. Series 55, 1964 (and various reprintings), p. 831.
  • L. Comtet, Advanced Combinatorics, Reidel, 1974, pp. 94, 96 and 307.
  • F. N. David, M. G. Kendall and D. E. Barton, Symmetric Function and Allied Tables, Cambridge, 1966, p. 219.
  • D. S. Mitrinovic et al., Handbook of Number Theory, Kluwer, Section XIV.2, p. 493.

Crossrefs

Columns (offset) include A057427, A004526, A001399, A001400, A001401, etc. Cf. A000009 (row sums), A008289 (without zeros), A030699 (row maximum), A008284 (partition triangle including duplications).
See A008289 for another version.

Programs

  • Maple
    b:= proc(n, i) b(n, i):= `if`(n=0, [1], `if`(i<1, [], zip((x, y)
          -> x+y, b(n, i-1), `if`(i>n, [], [0, b(n-i, i-1)[]]), 0)))
        end:
    T:= proc(n) local l; l:= subsop(1=NULL, b(n, n));
          l[], 0$(n-nops(l))
        end:
    seq(T(n), n=1..20);  # Alois P. Heinz, Dec 12 2012
  • Mathematica
    Flatten[Table[Length[Select[IntegerPartitions[n,{k}],Max[Transpose[ Tally[#]][[2]]]==1&]],{n,20},{k,n}]] (* Harvey P. Dale, Feb 27 2012 *)
    T[, 1] = 1; T[n, k_] /; 1, ] = 0; Table[T[n, k], {n, 1, 20}, {k, 1, n}] // Flatten (* Jean-François Alcover, Oct 26 2015 *)
  • PARI
    N=16;  q='q+O('q^N);
    gf=sum(n=0,N, z^n * q^((n^2+n)/2) / prod(k=1,n, 1-q^k ) );
    /* print triangle: */
    gf -= 1; /* remove row zero */
    P=Pol(gf,'q);
    { for (n=1,N-1,
        p = Pol(polcoeff(P, n),'z);
        p += 'z^(n+1);  /* preserve trailing zeros */
        v = Vec(polrecip(p));
        v = vector(n,k,v[k]); /* trim to size n */
        print(v);
    ); }
    /* Joerg Arndt, Oct 20 2012 */

Formula

T(n, k) = T(n-k, k) + T(n-k, k-1) [with T(n, 0)=1 if n=0 and 0 otherwise].
G.f.: Sum_{n>=0} z^n * q^((n^2+n)/2) / Product_{k=1..n} (1-q^k), rows by powers of q, columns by powers of z; includes row 0 (drop term for n=0 for this triangle, see PARI code); setting z=1 gives g.f. for A000009; cf. to g.f. for A072574. - Joerg Arndt, Oct 20 2012

Extensions

More terms, recurrence, etc. from Henry Bottomley, Mar 26 2001

A336342 Number of ways to choose a partition of each part of a strict composition of n.

Original entry on oeis.org

1, 1, 2, 7, 11, 29, 81, 155, 312, 708, 1950, 3384, 7729, 14929, 32407, 81708, 151429, 305899, 623713, 1234736, 2463743, 6208978, 10732222, 22487671, 43000345, 86573952, 160595426, 324990308, 744946690, 1336552491, 2629260284, 5050032692, 9681365777
Offset: 0

Views

Author

Gus Wiseman, Jul 18 2020

Keywords

Comments

A strict composition of n is a finite sequence of distinct positive integers summing to n.
Is there a simple generating function?

Examples

			The a(1) = 1 through a(4) = 11 ways:
  (1)  (2)    (3)        (4)
       (1,1)  (2,1)      (2,2)
              (1,1,1)    (3,1)
              (1),(2)    (1),(3)
              (2),(1)    (2,1,1)
              (1),(1,1)  (3),(1)
              (1,1),(1)  (1,1,1,1)
                         (1),(2,1)
                         (2,1),(1)
                         (1),(1,1,1)
                         (1,1,1),(1)
		

Crossrefs

Multiset partitions of partitions are A001970.
Strict compositions are counted by A032020, A072574, and A072575.
Splittings of partitions are A323583.
Splittings of partitions with distinct sums are A336131.
Partitions:
- Partitions of each part of a partition are A063834.
- Compositions of each part of a partition are A075900.
- Strict partitions of each part of a partition are A270995.
- Strict compositions of each part of a partition are A336141.
Strict partitions:
- Partitions of each part of a strict partition are A271619.
- Compositions of each part of a strict partition are A304961.
- Strict partitions of each part of a strict partition are A279785.
- Strict compositions of each part of a strict partition are A336142.
Compositions:
- Partitions of each part of a composition are A055887.
- Compositions of each part of a composition are A133494.
- Strict partitions of each part of a composition are A304969.
- Strict compositions of each part of a composition are A307068.
Strict compositions:
- Partitions of each part of a strict composition are A336342.
- Compositions of each part of a strict composition are A336127.
- Strict partitions of each part of a strict composition are A336343.
- Strict compositions of each part of a strict composition are A336139.

Programs

  • Mathematica
    Table[Length[Join@@Table[Tuples[IntegerPartitions/@ctn],{ctn,Join@@Permutations/@Select[IntegerPartitions[n],UnsameQ@@#&]}]],{n,0,10}]
  • PARI
    seq(n)={[subst(serlaplace(p),y,1) | p<-Vec(prod(k=1, n, 1 + y*x^k*numbpart(k) + O(x*x^n)))]} \\ Andrew Howroyd, Apr 16 2021

Formula

G.f.: Sum_{k>=0} k! * [y^k](Product_{j>=1} 1 + y*x^j*A000041(j)). - Andrew Howroyd, Apr 16 2021

A216652 Triangular array read by rows: T(n,k) is the number of compositions of n into exactly k distinct parts.

Original entry on oeis.org

1, 1, 1, 2, 1, 2, 1, 4, 1, 4, 6, 1, 6, 6, 1, 6, 12, 1, 8, 18, 1, 8, 24, 24, 1, 10, 30, 24, 1, 10, 42, 48, 1, 12, 48, 72, 1, 12, 60, 120, 1, 14, 72, 144, 120, 1, 14, 84, 216, 120, 1, 16, 96, 264, 240, 1, 16, 114, 360, 360, 1, 18, 126, 432, 600, 1, 18, 144, 552, 840
Offset: 1

Views

Author

Geoffrey Critzer, Sep 12 2012

Keywords

Comments

Same as A072574, with zeros dropped. [Joerg Arndt, Oct 20 2012]
Row sums = A032020.
Row n contains A003056(n) = floor((sqrt(8*n+1)-1)/2) terms (number of terms increases by one at each triangular number).

Examples

			Triangle starts:
[ 1]  1;
[ 2]  1;
[ 3]  1, 2;
[ 4]  1, 2;
[ 5]  1, 4;
[ 6]  1, 4, 6;
[ 7]  1, 6, 6;
[ 8]  1, 6, 12;
[ 9]  1, 8, 18;
[10]  1, 8, 24, 24;
[11]  1, 10, 30, 24;
[12]  1, 10, 42, 48;
[13]  1, 12, 48, 72;
[14]  1, 12, 60, 120;
[15]  1, 14, 72, 144, 120;
[16]  1, 14, 84, 216, 120;
[17]  1, 16, 96, 264, 240;
[18]  1, 16, 114, 360, 360;
[19]  1, 18, 126, 432, 600;
[20]  1, 18, 144, 552, 840;
T(5,2) = 4 because we have: 4+1, 1+4, 3+2, 2+3.
		

Crossrefs

Programs

  • Maple
    b:= proc(n, k) option remember; `if`(n<0, 0, `if`(n=0, 1,
          `if`(k<1, 0, b(n, k-1) +b(n-k, k))))
        end:
    T:= (n, k)-> b(n-k*(k+1)/2, k)*k!:
    seq(seq(T(n, k), k=1..floor((sqrt(8*n+1)-1)/2)), n=1..24);  # Alois P. Heinz, Sep 12 2012
  • Mathematica
    nn=20;f[list_]:=Select[list,#>0&];Map[f,Drop[CoefficientList[Series[ Sum[Product[j y x^j/(1-x^j),{j,1,k}],{k,0,nn}],{x,0,nn}],{x,y}],1]]//Flatten

Formula

G.f.: Sum_{i>=0} Product_{j=1..i} y*j*x^j/(1-x^j).
T(n,k) = A008289(n,k)*k!.

A336139 Number of ways to choose a strict composition of each part of a strict composition of n.

Original entry on oeis.org

1, 1, 1, 5, 9, 17, 45, 81, 181, 397, 965, 1729, 3673, 7313, 15401, 34065, 68617, 135069, 266701, 556969, 1061921, 2434385, 4436157, 9120869, 17811665, 35651301, 68949549, 136796317, 283612973, 537616261, 1039994921, 2081261717, 3980842425, 7723253181, 15027216049
Offset: 0

Views

Author

Gus Wiseman, Jul 16 2020

Keywords

Comments

A strict composition of n is a finite sequence of distinct positive integers summing to n.

Examples

			The a(1) = 1 through a(5) = 17 splittings:
  (1)  (2)  (3)      (4)        (5)
            (1,2)    (1,3)      (1,4)
            (2,1)    (3,1)      (2,3)
            (1),(2)  (1),(3)    (3,2)
            (2),(1)  (3),(1)    (4,1)
                     (1),(1,2)  (1),(4)
                     (1),(2,1)  (2),(3)
                     (1,2),(1)  (3),(2)
                     (2,1),(1)  (4),(1)
                                (1),(1,3)
                                (1,2),(2)
                                (1),(3,1)
                                (1,3),(1)
                                (2),(1,2)
                                (2,1),(2)
                                (2),(2,1)
                                (3,1),(1)
		

Crossrefs

The version for partitions is A063834.
Row sums of A072574.
The version for non-strict compositions is A133494.
The version for strict partitions is A279785.
Multiset partitions of partitions are A001970.
Strict compositions are A032020.
Taking a composition of each part of a partition: A075900.
Taking a composition of each part of a strict partition: A304961.
Taking a strict composition of each part of a composition: A307068.
Splittings of partitions are A323583.
Compositions of parts of strict compositions are A336127.
Set partitions of strict compositions are A336140.

Programs

  • Mathematica
    strs[n_]:=Join@@Permutations/@Select[IntegerPartitions[n],UnsameQ@@#&];
    Table[Length[Join@@Table[Tuples[strs/@ctn],{ctn,strs[n]}]],{n,0,15}]

A072575 Triangle T(n,k) of number of compositions (ordered partitions) of n into distinct parts where largest part is exactly k, 1<=k<=n.

Original entry on oeis.org

1, 0, 1, 0, 2, 1, 0, 0, 2, 1, 0, 0, 2, 2, 1, 0, 0, 6, 2, 2, 1, 0, 0, 0, 8, 2, 2, 1, 0, 0, 0, 6, 8, 2, 2, 1, 0, 0, 0, 6, 8, 8, 2, 2, 1, 0, 0, 0, 24, 12, 8, 8, 2, 2, 1, 0, 0, 0, 0, 30, 14, 8, 8, 2, 2, 1, 0, 0, 0, 0, 30, 36, 14, 8, 8, 2, 2, 1, 0, 0, 0, 0, 24, 36, 38, 14, 8, 8, 2, 2, 1, 0, 0, 0, 0, 24, 54, 42, 38, 14, 8, 8, 2, 2, 1
Offset: 1

Views

Author

Henry Bottomley, Jun 21 2002

Keywords

Examples

			Rows start:
  1;
  0, 1;
  0, 2, 1;
  0, 0, 2, 1;
  0, 0, 2, 2, 1;
  0, 0, 6, 2, 2, 1;
  0, 0, 0, 8, 2, 2, 1;
  0, 0, 0, 6, 8, 2, 2, 1;
  ...
T(7,4)=8 since 7 can be written as 4+3 =4+2+1 =4+1+2 =3+4 =2+4+1 =2+1+4 =1+4+2 =1+2+4.
		

Crossrefs

Cf. A026836, A072574. Row sums are A032020. Column sums appear to be A001339 (offset). Starting terms of columns tend towards A072576 as k increases.

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n=0, 1,
          `if`(i<1, [][], zip((x, y)->x+y, [b(n, i-1)],
          `if`(i>n, [], [0, b(n-i, i-1)]), 0)[]))
        end:
    T:= proc(n, k) local l; l:= [b(n-k, k-1)];
           add(l[i]*(i)!, i=1..nops(l))
        end:
    seq(seq(T(n, k), k=1..n), n=1..20);  # Alois P. Heinz, Nov 20 2012
  • Mathematica
    b[n_, i_] := b[n, i] = If[n == 0, {1}, If[i<1, {}, Plus @@ PadRight[{b[n, i-1], If[i>n, {}, Join[{0}, b[n-i, i-1]]]}]]]; T[n_, k_] := Module[{l}, l = b[n-k, k-1]; Sum[l[[i]]*i!, {i, 1, Length[l]}]]; Table[Table [T[n, k], {k, 1, n}], {n, 1, 20}] // Flatten (* Jean-François Alcover, Jan 31 2014, after Alois P. Heinz *)

A097910 Number of parts in all compositions of n into distinct parts.

Original entry on oeis.org

1, 1, 5, 5, 9, 27, 31, 49, 71, 185, 207, 339, 457, 685, 1421, 1745, 2577, 3615, 5143, 6877, 13439, 15965, 23823, 31983, 45553, 59425, 83549, 139013, 173769, 244803, 330391, 452257, 597935, 810929, 1052559, 1692723, 2074321, 2890333, 3783821, 5178041, 6658377
Offset: 1

Views

Author

Vladeta Jovovic, Sep 04 2004

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n=0, 1,
          `if`(n>i*(i+1)/2, [][], zip((x, y)->x+y, [b(n, i-1)],
          `if`(i>n, [], [0, b(n-i, i-1)]), 0)[]))
        end:
    a:= n-> (l-> add(i*l[i+1]*i!, i=1..nops(l)-1))([b(n$2)]):
    seq(a(n), n=1..50);  # Alois P. Heinz, Nov 20 2012
    # second Maple program:
    b:= proc(n, i, p) option remember; `if`(i*(i+1)/2 b(n$2, 0):
    seq(a(n), n=0..50);  # Alois P. Heinz, Aug 10 2020
  • Mathematica
    Drop[ CoefficientList[ Series[ Sum[ k*k!*x^((k^2 + k)/2)/Product[1 - x^j, {j, 1, k}], {k, 1, 45}], {x, 0, 40}], x], 1] (* Robert G. Wilson v, Sep 08 2004 *)

Formula

G.f.: Sum(k >= 0; k*k! x^((k^2+k)/2) / Prod(1<=j<=k; 1-x^j)).
a(n) = Sum_{k=1..floor((sqrt(8*n+1)-1)/2)} k! * k * A008289(n,k). - Alois P. Heinz, Aug 10 2020

Extensions

More terms from Robert G. Wilson v and John W. Layman, Sep 08 2004

A072705 Triangle of number of unimodal compositions of n into exactly k distinct terms.

Original entry on oeis.org

1, 1, 0, 1, 2, 0, 1, 2, 0, 0, 1, 4, 0, 0, 0, 1, 4, 4, 0, 0, 0, 1, 6, 4, 0, 0, 0, 0, 1, 6, 8, 0, 0, 0, 0, 0, 1, 8, 12, 0, 0, 0, 0, 0, 0, 1, 8, 16, 8, 0, 0, 0, 0, 0, 0, 1, 10, 20, 8, 0, 0, 0, 0, 0, 0, 0, 1, 10, 28, 16, 0, 0, 0, 0, 0, 0, 0, 0, 1, 12, 32, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 12, 40, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 1

Views

Author

Henry Bottomley, Jul 04 2002

Keywords

Comments

Also the number of compositions of n into exactly k distinct terms whose negation is unimodal. - Gus Wiseman, Mar 06 2020

Examples

			Rows start: 1; 1,0; 1,2,0; 1,2,0,0; 1,4,0,0,0; 1,4,4,0,0,0; 1,6,4,0,0,0,0; 1,6,8,0,0,0,0,0; etc. T(6,3)=4 since 6 can be written as 1+2+3, 1+3+2, 2+3+1, or 3+2+1 but not 2+1+3 or 3+1+2.
From _Gus Wiseman_, Mar 06 2020: (Start)
Triangle begins:
  1
  1  0
  1  2  0
  1  2  0  0
  1  4  0  0  0
  1  4  4  0  0  0
  1  6  4  0  0  0  0
  1  6  8  0  0  0  0  0
  1  8 12  0  0  0  0  0  0
  1  8 16  8  0  0  0  0  0  0
  1 10 20  8  0  0  0  0  0  0  0
  1 10 28 16  0  0  0  0  0  0  0  0
  1 12 32 24  0  0  0  0  0  0  0  0  0
  1 12 40 40  0  0  0  0  0  0  0  0  0  0
  1 14 48 48 16  0  0  0  0  0  0  0  0  0  0
(End)
		

Crossrefs

Cf. A060016, A072574, A072704. Row sums are A072706.
Column k = 2 is A052928.
Unimodal compositions are A001523.
Unimodal sequences covering an initial interval are A007052.
Strict compositions are A032020.
Non-unimodal strict compositions are A072707.
Unimodal compositions covering an initial interval are A227038.
Numbers whose prime signature is not unimodal are A332282.

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n>i*(i+1)/2, 0, `if`(n=0, 1,
          expand(b(n, i-1) +`if`(i>n, 0, x*b(n-i, i-1)))))
        end:
    T:= n-> (p-> seq(coeff(p, x, i)*ceil(2^(i-1)), i=1..n))(b(n$2)):
    seq(T(n), n=1..14);  # Alois P. Heinz, Mar 26 2014
  • Mathematica
    b[n_, i_] := b[n, i] = If[n > i*(i+1)/2, 0, If[n == 0, 1, Expand[b[n, i-1] + If[i > n, 0, x*b[n-i, i-1]]]]]; T[n_] := Function[{p}, Table[Coefficient[p, x, i]* Ceiling[2^(i-1)], {i, 1, n}]][b[n, n]]; Table[T[n], {n, 1, 14}] // Flatten (* Jean-François Alcover, Feb 26 2015, after Alois P. Heinz *)
    unimodQ[q_]:=Or[Length[q]<=1,If[q[[1]]<=q[[2]],unimodQ[Rest[q]],OrderedQ[Reverse[q]]]];
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n,{k}],UnsameQ@@#&&unimodQ[#]&]],{n,12},{k,n}] (* Gus Wiseman, Mar 06 2020 *)

Formula

T(n,k) = 2^(k-1)*A060016(n,k) = T(n-k,k)+2*T(n-k,k-1) [starting with T(0,0)=0, T(0,1)=0 and T(n,1)=1 for n>0].

A336343 Number of ways to choose a strict partition of each part of a strict composition of n.

Original entry on oeis.org

1, 1, 1, 4, 6, 11, 26, 39, 78, 142, 320, 488, 913, 1558, 2798, 5865, 9482, 16742, 28474, 50814, 82800, 172540, 266093, 472432, 790824, 1361460, 2251665, 3844412, 7205416, 11370048, 19483502, 32416924, 54367066, 88708832, 149179800, 239738369, 445689392
Offset: 0

Views

Author

Gus Wiseman, Jul 19 2020

Keywords

Comments

A strict composition of n (A032020) is a finite sequence of distinct positive integers summing to n.
Is there a simple generating function?

Examples

			The a(1) = 1 through a(5) = 11 ways:
  (1)  (2)  (3)      (4)        (5)
            (2,1)    (3,1)      (3,2)
            (1),(2)  (1),(3)    (4,1)
            (2),(1)  (3),(1)    (1),(4)
                     (1),(2,1)  (2),(3)
                     (2,1),(1)  (3),(2)
                                (4),(1)
                                (1),(3,1)
                                (2,1),(2)
                                (2),(2,1)
                                (3,1),(1)
		

Crossrefs

Multiset partitions of partitions are A001970.
Strict compositions are counted by A032020, A072574, and A072575.
Splittings of strict partitions are A072706.
Set partitions of strict partitions are A294617.
Splittings of partitions with distinct sums are A336131.
Partitions:
- Partitions of each part of a partition are A063834.
- Compositions of each part of a partition are A075900.
- Strict partitions of each part of a partition are A270995.
- Strict compositions of each part of a partition are A336141.
Strict partitions:
- Partitions of each part of a strict partition are A271619.
- Compositions of each part of a strict partition are A304961.
- Strict partitions of each part of a strict partition are A279785.
- Strict compositions of each part of a strict partition are A336142.
Compositions:
- Partitions of each part of a composition are A055887.
- Compositions of each part of a composition are A133494.
- Strict partitions of each part of a composition are A304969.
- Strict compositions of each part of a composition are A307068.
Strict compositions:
- Partitions of each part of a strict composition are A336342.
- Compositions of each part of a strict composition are A336127.
- Strict partitions of each part of a strict composition are A336343.
- Strict compositions of each part of a strict composition are A336139.

Programs

  • Mathematica
    strptn[n_]:=Select[IntegerPartitions[n],UnsameQ@@#&];
    Table[Length[Join@@Table[Tuples[strptn/@ctn],{ctn,Join@@Permutations/@strptn[n]}]],{n,0,10}]
  • PARI
    \\ here Q(N) gives A000009 as a vector.
    Q(n) = {Vec(eta(x^2 + O(x*x^n))/eta(x + O(x*x^n)))}
    seq(n)={my(b=Q(n)); [subst(serlaplace(p),y,1) | p<-Vec(prod(k=1, n, 1 + y*x^k*b[1+k] + O(x*x^n)))]} \\ Andrew Howroyd, Apr 16 2021

Formula

G.f.: Sum_{k>=0} k! * [y^k](Product_{j>=1} 1 + y*x^j*A000009(j)). - Andrew Howroyd, Apr 16 2021

A384891 Number of permutations of {1..n} with all distinct lengths of maximal runs (increasing by 1).

Original entry on oeis.org

1, 1, 1, 3, 3, 5, 23, 25, 43, 63, 345, 365, 665, 949, 1513, 8175, 9003, 15929, 23399, 36949, 51043, 293715, 314697, 570353, 826817, 1318201, 1810393, 2766099, 14180139, 15600413, 27707879, 40501321, 63981955, 88599903, 134362569, 181491125, 923029217
Offset: 0

Views

Author

Gus Wiseman, Jun 19 2025

Keywords

Examples

			The permutation (1,2,6,7,8,9,3,4,5) has maximal runs ((1,2),(6,7,8,9),(3,4,5)), with lengths (2,4,3), so is counted under a(9).
The a(0) = 1 through a(7) = 25 permutations:
  ()  (1)  (12)  (123)  (1234)  (12345)  (123456)  (1234567)
                 (231)  (2341)  (23451)  (123564)  (1234675)
                 (312)  (4123)  (34512)  (123645)  (1234756)
                                (45123)  (124563)  (1245673)
                                (51234)  (126345)  (1273456)
                                         (145623)  (1456723)
                                         (156234)  (1672345)
                                         (231456)  (2314567)
                                         (234156)  (2345167)
                                         (234561)  (2345671)
                                         (312456)  (3124567)
                                         (345126)  (3456127)
                                         (345612)  (3456712)
                                         (412356)  (4567123)
                                         (451236)  (4567231)
                                         (456231)  (4567312)
                                         (456312)  (5123467)
                                         (561234)  (5612347)
                                         (562341)  (5671234)
                                         (564123)  (6712345)
                                         (612345)  (6723451)
                                         (634512)  (6751234)
                                         (645123)  (7123456)
                                                   (7345612)
                                                   (7561234)
		

Crossrefs

Counting by number of maximal anti-runs gives A010027, for runs A123513.
For subsets instead of permutations we have A384175, complement A384176.
For partitions we have A384884 (anti-runs A384885), strict A384178 (anti-runs A384880).
For equal instead of distinct lengths we have A384892.
For anti-runs instead of runs we have A384907.
A000041 counts integer partitions, strict A000009.
A034839 counts subsets by number of maximal runs, for strict partitions A116674.
A098859 counts Wilf partitions (distinct multiplicities), complement A336866.
A356606 counts strict partitions without a neighborless part, complement A356607.
A384893 counts subsets by number of maximal anti-runs, for partitions A268193, A384905.

Programs

  • Mathematica
    Table[Length[Select[Permutations[Range[n]],UnsameQ@@Length/@Split[#,#2==#1+1&]&]],{n,0,10}]
  • PARI
    lista(n)=my(b(n)=sum(i=0,n-1,(-1)^i*(n-i)!*binomial(n-1,i)), d=floor(sqrt(2*n)), p=prod(i=1,n,1+x*y^i,1+O(y*y^n)*((1-x^(n+1))/(1-x))+O(x*x^d))); Vec(1+sum(i=1,d,i!*b(i)*polcoef(p,i))) \\ Christian Sievers, Jun 22 2025

Formula

a(n) = Sum_{k=1..n} ( T(n,k) * A000255(k-1) ) for n>=1, where T(n,k) is the number of compositions of n into k distinct parts (cf. A072574). - Christian Sievers, Jun 22 2025

Extensions

a(11) and beyond from Christian Sievers, Jun 22 2025

A333941 Triangle read by rows where T(n,k) is the number of compositions of n with rotational period k.

Original entry on oeis.org

1, 0, 1, 0, 2, 0, 0, 2, 2, 0, 0, 3, 2, 3, 0, 0, 2, 4, 6, 4, 0, 0, 4, 6, 9, 8, 5, 0, 0, 2, 6, 15, 20, 15, 6, 0, 0, 4, 8, 24, 32, 35, 18, 7, 0, 0, 3, 10, 27, 56, 70, 54, 28, 8, 0, 0, 4, 12, 42, 84, 125, 120, 84, 32, 9, 0, 0, 2, 10, 45, 120, 210, 252, 210, 120, 45, 10, 0
Offset: 0

Views

Author

Gus Wiseman, Apr 16 2020

Keywords

Comments

A composition of n is a finite sequence of positive integers summing to n.

Examples

			Triangle begins:
   1
   0   1
   0   2   0
   0   2   2   0
   0   3   2   3   0
   0   2   4   6   4   0
   0   4   6   9   8   5   0
   0   2   6  15  20  15   6   0
   0   4   8  24  32  35  18   7   0
   0   3  10  27  56  70  54  28   8   0
   0   4  12  42  84 125 120  84  32   9   0
   0   2  10  45 120 210 252 210 120  45  10   0
   0   6  18  66 168 335 450 462 320 162  50  11   0
Row n = 6 counts the following compositions (empty columns indicated by dots):
  .  (6)       (15)    (114)  (1113)  (11112)  .
     (33)      (24)    (123)  (1122)  (11121)
     (222)     (42)    (132)  (1131)  (11211)
     (111111)  (51)    (141)  (1221)  (12111)
               (1212)  (213)  (1311)  (21111)
               (2121)  (231)  (2112)
                       (312)  (2211)
                       (321)  (3111)
                       (411)
		

Crossrefs

Column k = 1 is A000005.
Row sums are A011782.
Diagonal T(2n,n) is A045630(n).
The strict version is A072574.
A version counting runs is A238279.
Column k = n - 1 is A254667.
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.
Period of binary expansion is A302291.
Numbers whose prime signature is aperiodic are A329139.
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.
- Constant compositions are A272919.
- Lyndon compositions are A275692.
- Co-Lyndon compositions are A326774.
- Aperiodic compositions are A328594.
- Rotational period is A333632.
- Co-necklaces are A333764.
- Reversed necklaces are A333943.

Programs

  • Mathematica
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],Function[c,Length[Union[Array[RotateRight[c,#]&,Length[c]]]]==k]]],{n,0,10},{k,0,n}]
  • PARI
    T(n,k)=if(n==0, k==0, sumdiv(n, m, sumdiv(gcd(k,m), d, moebius(d)*binomial(m/d-1, k/d-1)))) \\ Andrew Howroyd, Jan 19 2023

Formula

T(n,k) = Sum_{m|n} Sum_{d|gcd(k,m)} mu(d)*binomial(m/d-1, k/d-1) for n > 0. - Andrew Howroyd, Jan 19 2023
Showing 1-10 of 20 results. Next