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

A032020 Number of compositions (ordered partitions) of n into distinct parts.

Original entry on oeis.org

1, 1, 1, 3, 3, 5, 11, 13, 19, 27, 57, 65, 101, 133, 193, 351, 435, 617, 851, 1177, 1555, 2751, 3297, 4757, 6293, 8761, 11305, 15603, 24315, 30461, 41867, 55741, 74875, 98043, 130809, 168425, 257405, 315973, 431065, 558327, 751491, 958265, 1277867, 1621273
Offset: 0

Views

Author

Christian G. Bower, Apr 01 1998

Keywords

Comments

Compositions into distinct parts are equivalent to (1,1)-avoiding compositions. - Gus Wiseman, Jun 25 2020
All terms are odd. - Alois P. Heinz, Apr 09 2021

Examples

			a(6) = 11 because 6 = 5+1 = 4+2 = 3+2+1 = 3+1+2 = 2+4 = 2+3+1 = 2+1+3 = 1+5 = 1+3+2 = 1+2+3.
From _Gus Wiseman_, Jun 25 2020: (Start)
The a(0) = 1 through a(7) = 13 strict compositions:
  ()  (1)  (2)  (3)    (4)    (5)    (6)      (7)
                (1,2)  (1,3)  (1,4)  (1,5)    (1,6)
                (2,1)  (3,1)  (2,3)  (2,4)    (2,5)
                              (3,2)  (4,2)    (3,4)
                              (4,1)  (5,1)    (4,3)
                                     (1,2,3)  (5,2)
                                     (1,3,2)  (6,1)
                                     (2,1,3)  (1,2,4)
                                     (2,3,1)  (1,4,2)
                                     (3,1,2)  (2,1,4)
                                     (3,2,1)  (2,4,1)
                                              (4,1,2)
                                              (4,2,1)
(End)
		

References

  • Mohammad K. Azarian, A Generalization of the Climbing Stairs Problem II, Missouri Journal of Mathematical Sciences, Vol. 16, No. 1, Winter 2004, pp. 12-17.

Crossrefs

Row sums of A241719.
Main diagonal of A261960.
Dominated by A003242 (anti-run compositions).
These compositions are ranked by A233564.
(1,1)-avoiding patterns are counted by A000142.
Numbers with strict prime signature are A130091.
(1,1,1)-avoiding compositions are counted by A232432.
(1,1)-matching compositions are counted by A261982.
Inseparable partitions are counted by A325535.
Patterns matched by compositions are counted by A335456.
Strict permutations of prime indices are counted by A335489.

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:
    a:= proc(n) local l; l:=b(n, n): add((i-1)! *l[i], i=1..nops(l)) end:
    seq(a(n), n=0..50);  # Alois P. Heinz, Dec 12 2012
    # second Maple program:
    T:= proc(n, k) option remember; `if`(k<0 or n<0, 0,
          `if`(k=0, `if`(n=0, 1, 0), T(n-k, k) +k*T(n-k, k-1)))
        end:
    a:= n-> add(T(n, k), k=0..floor((sqrt(8*n+1)-1)/2)):
    seq(a(n), n=0..60);  # Alois P. Heinz, Sep 04 2015
  • Mathematica
    f[list_]:=Length[list]!; Table[Total[Map[f, Select[IntegerPartitions[n], Sort[#] == Union[#] &]]], {n, 0,30}]
    T[n_, k_] := T[n, k] = If[k<0 || n<0, 0, If[k==0, If[n==0, 1, 0], T[n-k, k] + k*T[n-k, k-1]]]; a[n_] := Sum[T[n, k], {k, 0, Floor[(Sqrt[8*n + 1] - 1) / 2]}]; Table[a[n], {n, 0, 60}] (* Jean-François Alcover, Sep 22 2015, after Alois P. Heinz *)
  • PARI
    N=66;  q='q+O('q^N);
    gf=sum(n=0,N, n!*q^(n*(n+1)/2) / prod(k=1,n, 1-q^k ) );
    Vec(gf)
    /* Joerg Arndt, Oct 20 2012 */
    
  • PARI
    Q(N) = { \\ A008289
      my(q = vector(N)); q[1] = [1, 0, 0, 0];
      for (n = 2, N,
        my(m = (sqrtint(8*n+1) - 1)\2);
        q[n] = vector((1 + (m>>2)) << 2); q[n][1] = 1;
        for (k = 2, m, q[n][k] = q[n-k][k] + q[n-k][k-1]));
      return(q);
    };
    seq(N) = concat(1, apply(q -> sum(k = 1, #q, q[k] * k!), Q(N)));
    seq(43) \\ Gheorghe Coserea, Sep 09 2018

Formula

"AGK" (ordered, elements, unlabeled) transform of 1, 1, 1, 1, ...
G.f.: Sum_{k>=0} k! * x^((k^2+k)/2) / Product_{j=1..k} (1-x^j). - David W. Wilson May 04 2000
a(n) = Sum_{m=1..n} A008289(n,m)*m!. - Geoffrey Critzer, Sep 07 2012

A243081 Number A(n,k) of compositions of n into parts with multiplicity not larger than k; square array A(n,k), n>=0, k>=0, read by antidiagonals.

Original entry on oeis.org

1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 2, 3, 0, 1, 1, 2, 3, 3, 0, 1, 1, 2, 4, 7, 5, 0, 1, 1, 2, 4, 7, 11, 11, 0, 1, 1, 2, 4, 8, 15, 21, 13, 0, 1, 1, 2, 4, 8, 15, 26, 34, 19, 0, 1, 1, 2, 4, 8, 16, 31, 52, 59, 27, 0, 1, 1, 2, 4, 8, 16, 31, 57, 93, 114, 57, 0, 1, 1, 2, 4, 8, 16, 32, 63, 114, 173, 178, 65, 0
Offset: 0

Views

Author

Alois P. Heinz, May 29 2014

Keywords

Comments

A(n,k) is the number of compositions of n avoiding the pattern {1}^(k+1).

Examples

			Square array A(n,k) begins:
  1,  1,  1,  1,   1,   1,   1,   1,   1, ...
  0,  1,  1,  1,   1,   1,   1,   1,   1, ...
  0,  1,  2,  2,   2,   2,   2,   2,   2, ...
  0,  3,  3,  4,   4,   4,   4,   4,   4, ...
  0,  3,  7,  7,   8,   8,   8,   8,   8, ...
  0,  5, 11, 15,  15,  16,  16,  16,  16, ...
  0, 11, 21, 26,  31,  31,  32,  32,  32, ...
  0, 13, 34, 52,  57,  63,  63,  64,  64, ...
  0, 19, 59, 93, 114, 120, 127, 127, 128, ...
		

Crossrefs

Main diagonal gives A011782.
A(2n,n) gives A232605.

Programs

  • Maple
    b:= proc(n, i, p, k) option remember; `if`(n=0, p!, `if`(i<1, 0,
          add(b(n-i*j, i-1, p+j, k)/j!, j=0..min(n/i, k))))
        end:
    A:= (n, k)-> `if`(k>=n, `if`(n=0, 1, 2^(n-1)), b(n$2, 0, k)):
    seq(seq(A(n, d-n), n=0..d), d=0..14);
  • Mathematica
    b[n_, i_, p_, k_] := b[n, i, p, k] = If[n == 0, p!, If[i<1, 0,
         Sum[b[n-i*j, i-1, p+j, k]/j!, {j, 0, Min[n/i, k]}]]];
    A[n_, k_] := If[k >= n, If[n == 0, 1, 2^(n-1)], b[n, n, 0, k]];
    Table[Table[A[n, d-n], {n, 0, d}], {d, 0, 14}] // Flatten (* Jean-François Alcover, Feb 02 2015, after Alois P. Heinz *)

Formula

A(n,k) = Sum_{i=0..k} A242447(n,i).

A242451 Number T(n,k) of compositions of n in which the minimal multiplicity of parts equals k; triangle T(n,k), n>=0, 0<=k<=n, read by rows.

Original entry on oeis.org

1, 0, 1, 0, 1, 1, 0, 3, 0, 1, 0, 6, 1, 0, 1, 0, 15, 0, 0, 0, 1, 0, 23, 7, 1, 0, 0, 1, 0, 53, 10, 0, 0, 0, 0, 1, 0, 94, 32, 0, 1, 0, 0, 0, 1, 0, 203, 31, 21, 0, 0, 0, 0, 0, 1, 0, 404, 71, 35, 0, 1, 0, 0, 0, 0, 1, 0, 855, 77, 91, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1648, 222, 105, 71, 0, 1, 0, 0, 0, 0, 0, 1
Offset: 0

Views

Author

Alois P. Heinz, May 15 2014

Keywords

Comments

T(0,0) = 1 by convention. T(n,k) counts the compositions of n in which at least one part has multiplicity k and no part has a multiplicity smaller than k.
T(n,n) = T(2n,n) = 1.
T(3n,n) = A244174(n).

Examples

			T(5,1) = 15: [1,1,1,2], [1,1,2,1], [1,2,1,1], [2,1,1,1], [1,2,2], [2,1,2], [2,2,1], [1,1,3], [1,3,1], [3,1,1], [2,3], [3,2], [1,4], [4,1], [5].
T(6,2) = 7: [1,1,2,2], [1,2,1,2], [1,2,2,1], [2,1,1,2], [2,1,2,1], [2,2,1,1], [3,3].
T(6,3) = 1: [2,2,2].
Triangle T(n,k) begins:
  1;
  0,   1;
  0,   1,  1;
  0,   3,  0,  1;
  0,   6,  1,  0, 1;
  0,  15,  0,  0, 0, 1;
  0,  23,  7,  1, 0, 0, 1;
  0,  53, 10,  0, 0, 0, 0, 1;
  0,  94, 32,  0, 1, 0, 0, 0, 1;
  0, 203, 31, 21, 0, 0, 0, 0, 0, 1;
  0, 404, 71, 35, 0, 1, 0, 0, 0, 0, 1;
		

Crossrefs

Row sums give A011782.
Cf. A242447 (the same for maximal multiplicity), A243978 (the same for partitions).

Programs

  • Maple
    b:= proc(n, i, p, k) option remember; `if`(n=0, p!, `if`(i<1, 0,
           b(n, i-1, p, k) +add(b(n-i*j, i-1, p+j, k)/j!,
           j=max(1, k)..floor(n/i))))
        end:
    T:= (n, k)-> b(n$2, 0, k) -`if`(n=0 and k=0, 0, b(n$2, 0, k+1)):
    seq(seq(T(n, k), k=0..n), n=0..14);
  • Mathematica
    b[n_, i_, p_, k_] := b[n, i, p, k] = If[n == 0, p!, If[i < 1, 0, b[n, i - 1, p, k] + Sum[b[n - i*j, i - 1, p + j, k]/j!, {j, Max[1, k], Floor[n/i]}]]]; T[n_, k_] := b[n, n, 0, k] - If[n == 0 && k == 0, 0, b[n, n, 0, k + 1]]; Table[Table[T[n, k], {k, 0, n}], {n, 0, 14}] // Flatten (* Jean-François Alcover, Jan 27 2015, after Alois P. Heinz *)

A232665 Number of compositions of 2n such that the largest multiplicity of parts equals n.

Original entry on oeis.org

1, 1, 4, 5, 21, 49, 176, 513, 1720, 5401, 17777, 57421, 188657, 617177, 2033176, 6697745, 22139781, 73262233, 242931322, 806516561, 2681475049, 8925158441, 29740390673, 99196158145, 331163178476, 1106489052969, 3699881730901, 12380449027325, 41454579098853
Offset: 0

Views

Author

Alois P. Heinz, Nov 27 2013

Keywords

Comments

a(n) = A238342(2n,n) = A242447(2n,n).

Examples

			a(1) = 1: [2].
a(2) = 4: [2,2], [1,2,1], [2,1,1], [1,1,2].
a(3) = 5: [2,2,2], [1,3,1,1], [1,1,3,1], [3,1,1,1], [1,1,1,3].
a(4) = 21: [2,2,2,2], [1,1,4,1,1], [4,1,1,1,1], [1,4,1,1,1], [1,1,1,4,1], [1,1,1,1,4], [1,2,1,1,1,2], [2,1,1,1,1,2], [2,1,2,1,1,1], [1,2,2,1,1,1],[1,2,1,2,1,1], [2,1,1,2,1,1], [1,2,1,1,2,1], [2,1,1,1,2,1],[1,1,2,1,2,1], [1,1,2,2,1,1], [2,2,1,1,1,1], [1,1,1,2,2,1], [1,1,2,1,1,2], [1,1,1,2,1,2], [1,1,1,1,2,2].
		

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember;
         `if`(n<5, [1, 1, 4, 5, 21][n+1],
          ((n-1)*(14911*n^4 -102036*n^3 +249203*n^2
           -252880*n +87794) *a(n-1)
          +(27528*n^5 -239548*n^4 +803564*n^3 -1283816*n^2
           +963472*n -266160) *a(n-2)
          -2*(2*n-5)*(10323*n^4 -62876*n^3 +136848*n^2
           -125584*n +40329) *a(n-3)
          +2*(2*n-7)*(n-2)*(1147*n^3 -4055*n^2 +4742*n
           -1762) *a(n-4)) / (5*(n-1)*n*
          (1147*n^3 -7496*n^2 +16293*n -11706)))
        end:
    seq(a(n), n=0..35);
  • Mathematica
    b[n_, s_] := b[n, s] = If[n == 0, 1, If[nJean-François Alcover, Feb 09 2015, after A238342 *)

Formula

Recurrence: see Maple program.
a(n) ~ c*r^n/sqrt(Pi*n), where r = 3.408698199842151... is the root of the equation 4 - 32*r - 8*r^2 + 5*r^3 = 0 and c = 0.479880052557486135... is the root of the equation 1 + 384*c^2 - 2368*c^4 + 2960*c^6 = 0. - Vaclav Kotesovec, Nov 27 2013

A232605 Number of compositions of 2n into parts with multiplicity <= n.

Original entry on oeis.org

1, 1, 7, 26, 114, 459, 1892, 7660, 31081, 125464, 506025, 2036706, 8189555, 32894825, 132033140, 529614616, 2123365038, 8509634259, 34092146068, 136546197412, 546774790297, 2189060331762, 8762770476060, 35072837719356, 140363923730474, 561697985182654
Offset: 0

Views

Author

Alois P. Heinz, Nov 26 2013

Keywords

Comments

a(n) = A243081(2n,n) = Sum_{i=0..n} A242447(2n,i).

Examples

			a(1) = 1: [2].
a(2) = 7: [4], [3,1], [2,2], [1,3], [2,1,1], [1,2,1], [1,1,2].
a(3) = 26: [6], [5,1], [4,2], [3,3], [2,4], [1,5], [3,2,1], [2,3,1], [1,4,1], [3,1,2], [2,2,2], [1,3,2], [2,1,3], [1,2,3], [1,1,4], [4,1,1], [2,1,2,1], [1,2,2,1], [1,1,3,1], [3,1,1,1], [2,2,1,1], [1,1,2,2], [1,1,1,3], [1,3,1,1], [2,1,1,2], [1,2,1,2].
		

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember;
         `if`(n<5, [1, 1, 7, 26, 114][n+1],
          (2*(n-1)*(11092322562903*n^3 -66692687083623*n^2
           +117736395568913*n -51473509383358) *a(n-1)
          -(17386283060104*n^4 -178154697569624*n^3 +652039987731328*n^2
           -984836231488344*n +485931992440304) *a(n-2)
          -(89948343833304*n^4 -664733317200192*n^3 +1662507315916082*n^2
           -1594206267597886*n +485625773146800) *a(n-3)
          +(92866735410328*n^4 -1047423564207444*n^3 +4160804083968884*n^2
           -6634447008138888*n +3217864137236880) *a(n-4)
          -16*(n-5)*(2*n-9)*(310469340359*n^2 -847919784312*n
           +494768703748) *a(n-5)) / (5*n*(n-1)*
          (681426847222*n^2 -3587414825361*n +4663189129034)))
        end:
    seq(a(n), n=0..40);
  • Mathematica
    b[n_, i_, p_, k_] := b[n, i, p, k] = If[n == 0, p!, If[i < 1, 0, Sum[b[n - i*j, i - 1, p + j, k]/j!, {j, 0, Min[n/i, k]}]]];
    A[n_, k_] := If[k >= n, If[n == 0, 1, 2^(n - 1)], b[n, n, 0, k]];
    a[n_] := A[2 n, n];
    Table[a[n], {n, 0, 30}] (* Jean-François Alcover, Mar 31 2017, after Alois P. Heinz *)

Formula

Recurrence: 5*(n-2)*(n-1)*n*(1258*n^4 - 11230*n^3 + 37013*n^2 - 53645*n + 28764)*a(n) = 2*(n-2)*(n-1)*(17612*n^5 - 159736*n^4 + 538872*n^3 - 824111*n^2 + 541051*n - 107568)*a(n-1) - 4*(n-2)*(5032*n^5 - 44925*n^4 + 134332*n^3 - 137541*n^2 - 6614*n + 52596)*a(n-2) - 2*(83028*n^7 - 1074550*n^6 + 5758938*n^5 - 16516699*n^4 + 27297714*n^3 - 25934731*n^2 + 13070460*n - 2661120)*a(n-3) + 8*(n-4)*(n-1)*(2*n-7)*(1258*n^4 - 6198*n^3 + 10871*n^2 - 8277*n + 2160)*a(n-4). - Vaclav Kotesovec, Nov 27 2013
a(n) ~ 2^(2*n-1). - Vaclav Kotesovec, Nov 27 2013

A243119 Number of compositions of n in which the maximal multiplicity of parts equals 2.

Original entry on oeis.org

1, 0, 4, 6, 10, 21, 40, 87, 121, 219, 421, 690, 1159, 1782, 3304, 5190, 8212, 12897, 22084, 33255, 53617, 82539, 124849, 206172, 313339, 472056, 714976, 1077996, 1682806, 2502645, 3804460, 5674305, 8340535, 12245241, 18851899, 27570366, 40385431, 59314572
Offset: 2

Views

Author

Alois P. Heinz, May 29 2014

Keywords

Examples

			a(6) = 10: [1,1,2,2], [1,2,1,2], [1,2,2,1], [2,1,1,2], [2,1,2,1], [2,2,1,1], [3,3], [1,1,4], [1,4,1], [4,1,1].
		

Crossrefs

Column k=2 of A242447.

Programs

  • Maple
    b:= proc(n, i, p, k) option remember; `if`(n=0, p!, `if`(i<1, 0,
          add(b(n-i*j, i-1, p+j, k)/j!, j=0..min(n/i, k))))
        end:
    a:= n-> b(n$2, 0, 2) -b(n$2, 0, 1):
    seq(a(n), n=2..45);

Formula

a(n) = A232432(n) - A032020(n) = A243081(n,2) - A243081(n,1).

A243120 Number of compositions of n in which the maximal multiplicity of parts equals 3.

Original entry on oeis.org

1, 0, 4, 5, 18, 34, 59, 132, 272, 519, 966, 1746, 3487, 5986, 10570, 19701, 34444, 59250, 101155, 180588, 302788, 515205, 841042, 1449392, 2420163, 3959442, 6472636, 10656987, 17332640, 28234296, 45337971, 72306544, 117761744, 185704091, 295918788, 466574348
Offset: 3

Views

Author

Alois P. Heinz, May 29 2014

Keywords

Crossrefs

Column k=3 of A242447.

Programs

  • Maple
    b:= proc(n, i, p, k) option remember; `if`(n=0, p!, `if`(i<1, 0,
          add(b(n-i*j, i-1, p+j, k)/j!, j=0..min(n/i, k))))
        end:
    a:= n-> b(n$2, 0, 3) -b(n$2, 0, 2):
    seq(a(n), n=3..50);

Formula

a(n) = A232464(n) - A232432(n) = A243081(n,3) - A243081(n,2).

A243121 Number of compositions of n in which the maximal multiplicity of parts equals 4.

Original entry on oeis.org

1, 0, 5, 5, 21, 40, 100, 210, 396, 870, 1790, 3510, 6681, 13100, 25320, 47835, 87126, 166195, 299375, 542595, 991036, 1775935, 3145270, 5487805, 9852046, 17092310, 29561070, 50696690, 88015196, 150446590, 256066280, 428469220, 727919426, 1224816005, 2043828145
Offset: 4

Views

Author

Alois P. Heinz, May 29 2014

Keywords

Crossrefs

Column k=4 of A242447.

Programs

  • Maple
    b:= proc(n, i, p, k) option remember; `if`(n=0, p!, `if`(i<1, 0,
          add(b(n-i*j, i-1, p+j, k)/j!, j=0..min(n/i, k))))
        end:
    a:= n-> b(n$2, 0, 4) -b(n$2, 0, 3):
    seq(a(n), n=4..50);

Formula

a(n) = A243082(n) - A232464(n) = A243081(n,4) - A243081(n,3).

A243122 Number of compositions of n in which the maximal multiplicity of parts equals 5.

Original entry on oeis.org

1, 0, 6, 6, 27, 49, 131, 279, 635, 1370, 2722, 5877, 12170, 24113, 47660, 94470, 186623, 355400, 680074, 1296600, 2456115, 4535638, 8495447, 15570655, 28505689, 52054671, 94229227, 169184891, 301060621, 540575365, 956101463, 1682865787, 2936425870, 5167830927
Offset: 5

Views

Author

Alois P. Heinz, May 29 2014

Keywords

Crossrefs

Column k=5 of A242447.

Programs

  • Maple
    b:= proc(n, i, p, k) option remember; `if`(n=0, p!, `if`(i<1, 0,
          add(b(n-i*j, i-1, p+j, k)/j!, j=0..min(n/i, k))))
        end:
    a:= n-> b(n$2, 0, 5) -b(n$2, 0, 4):
    seq(a(n), n=5..50);

Formula

a(n) = A243083(n) - A243082(n) = A243081(n,5) - A243081(n,4).

A243123 Number of compositions of n in which the maximal multiplicity of parts equals 6.

Original entry on oeis.org

1, 0, 7, 7, 35, 63, 176, 378, 889, 1946, 4298, 9282, 18999, 40565, 84371, 169372, 340683, 684957, 1359758, 2650942, 5142116, 10008642, 19123713, 36370362, 68799767, 129920385, 241668105, 450604609, 830903577, 1529103100, 2800280316, 5100363926, 9233845628
Offset: 6

Views

Author

Alois P. Heinz, May 29 2014

Keywords

Crossrefs

Column k=6 of A242447.

Programs

  • Maple
    b:= proc(n, i, p, k) option remember; `if`(n=0, p!, `if`(i<1, 0,
          add(b(n-i*j, i-1, p+j, k)/j!, j=0..min(n/i, k))))
        end:
    a:= n-> b(n$2, 0, 6) -b(n$2, 0, 5):
    seq(a(n), n=6..50);

Formula

a(n) = A243084(n) - A243083(n) = A243081(n,6) - A243081(n,5).
Showing 1-10 of 14 results. Next