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

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

A232432 Number of compositions of n avoiding the pattern 111.

Original entry on oeis.org

1, 1, 2, 3, 7, 11, 21, 34, 59, 114, 178, 284, 522, 823, 1352, 2133, 3739, 5807, 9063, 14074, 23639, 36006, 56914, 87296, 131142, 214933, 324644, 487659, 739291, 1108457, 1724673, 2558386, 3879335, 5772348, 8471344, 12413666, 19109304, 27886339, 40816496
Offset: 0

Views

Author

Alois P. Heinz, Nov 23 2013

Keywords

Comments

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

Examples

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

Crossrefs

Cf. A000726 (partitions avoiding 111), A032020 (pattern 11), A128695 (adjacent pattern 111).
Column k=2 of A243081.
The case of partitions is ranked by A004709.
The version for patterns is A080599.
(1,1,1,1)-avoiding partitions are counted by A232464.
The (1,1,1)-matching version is A335455.
Patterns matched by compositions are counted by A335456.
The version for prime indices is A335511.
(1,1,1)-avoiding compositions are ranked by A335513.

Programs

  • Maple
    b:= proc(n, i, p) option remember; `if`(n=0, p!, `if`(i<1, 0,
          add(b(n-i*j, i-1, p+j)/j!, j=0..min(n/i, 2))))
        end:
    a:= n-> b(n$2, 0):
    seq(a(n), n=0..50);
  • Mathematica
    f[list_]:=Apply[And,Table[Count[list,i]<3,{i,1,Max[list]}]];
    g[list_]:=Length[list]!/Apply[Times,Table[Count[list,i]!,{i,1,Max[list]}]];
    a[n_] := If[n == 0, 1, Total[Map[g, Select[IntegerPartitions[n], f]]]];
    Table[a[n], {n, 0, 35}] (* Geoffrey Critzer, Nov 25 2013, updated by Jean-François Alcover, Nov 20 2023 *)

A232464 Number of compositions of n avoiding the pattern 1111.

Original entry on oeis.org

1, 1, 2, 4, 7, 15, 26, 52, 93, 173, 310, 556, 1041, 1789, 3098, 5620, 9725, 16377, 28764, 48518, 82889, 137161, 237502, 390084, 646347, 1055975, 1774036, 2907822, 4698733, 7581093, 12381660, 19891026, 32113631, 51110319, 80777888, 130175410, 204813395
Offset: 0

Views

Author

Alois P. Heinz, Nov 24 2013

Keywords

Comments

Number of compositions of n into parts with multiplicity <= 3.

Examples

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

Crossrefs

Cf. A001935 (partitions avoiding 1111), A032020 (pattern 11), A232432 (pattern 111), A232394 (consecutive pattern 1111).
Column k=3 of A243081.

Programs

  • Maple
    b:= proc(n, i, p) option remember; `if`(n=0, p!, `if`(i<1, 0,
          add(b(n-i*j, i-1, p+j)/j!, j=0..min(n/i, 3))))
        end:
    a:= n-> b(n$2, 0):
    seq(a(n), n=0..50);
  • Mathematica
    f[list_]:=Apply[And,Table[Count[list,i]<4,{i,1,Max[list]}]];
    g[list_]:=Length[list]!/Apply[Times,Table[Count[list,i]!,{i,1,Max[list]}]];
    a[n_] := If[n == 0, 1, Total[Map[g, Select[IntegerPartitions[n], f]]]];
    Table[a[n], {n, 0, 40}] (* Geoffrey Critzer, Nov 25 2013, updated by Jean-François Alcover, Nov 20 2023 *)

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

A243082 Number of compositions of n into parts with multiplicity not larger than 4.

Original entry on oeis.org

1, 1, 2, 4, 8, 15, 31, 57, 114, 213, 410, 766, 1437, 2659, 4888, 9130, 16406, 29477, 54084, 96353, 170015, 303356, 536877, 932679, 1637383, 2831910, 4919306, 8395627, 14550779, 24673403, 41942730, 70587716, 120128827, 201556909, 336844168, 558644630, 932732821
Offset: 0

Views

Author

Alois P. Heinz, May 29 2014

Keywords

Comments

Number of compositions of n avoiding the pattern 11111.

Crossrefs

Column k=4 of A243081.

Programs

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

A243083 Number of compositions of n into parts with multiplicity not larger than 5.

Original entry on oeis.org

1, 1, 2, 4, 8, 16, 31, 63, 120, 240, 459, 897, 1716, 3294, 6258, 11852, 22283, 41647, 78197, 144013, 264485, 489979, 892277, 1612753, 2933983, 5288025, 9454944, 16891074, 30121434, 53179092, 93997401, 164816943, 289313718, 502617530, 877419533, 1514746093
Offset: 0

Views

Author

Alois P. Heinz, May 29 2014

Keywords

Comments

Number of compositions of n avoiding the pattern 111111.

Crossrefs

Column k=5 of A243081.

Programs

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

A243084 Number of compositions of n into parts with multiplicity not larger than 6.

Original entry on oeis.org

1, 1, 2, 4, 8, 16, 32, 63, 127, 247, 494, 960, 1892, 3672, 7147, 13798, 26581, 50929, 97196, 184578, 348856, 659351, 1232960, 2297710, 4293741, 7938967, 14597060, 26899716, 49245147, 89549454, 162797168, 294737328, 530981823, 953222139, 1708323110, 3043849193
Offset: 0

Views

Author

Alois P. Heinz, May 29 2014

Keywords

Comments

Number of compositions of n avoiding the pattern {1}^7.

Crossrefs

Column k=6 of A243081.

Programs

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

A243085 Number of compositions of n into parts with multiplicity not larger than 7.

Original entry on oeis.org

1, 1, 2, 4, 8, 16, 32, 64, 127, 255, 502, 1004, 1972, 3908, 7660, 15044, 29361, 57209, 110982, 214648, 413552, 793936, 1518344, 2892496, 5500825, 10392649, 19569158, 36845760, 68891188, 128241332, 238736764, 442162796, 814790985, 1499513369, 2750419066
Offset: 0

Views

Author

Alois P. Heinz, May 29 2014

Keywords

Comments

Number of compositions of n avoiding the pattern {1}^8.

Crossrefs

Column k=7 of A243081.

Programs

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

A243086 Number of compositions of n into parts with multiplicity not larger than 8.

Original entry on oeis.org

1, 1, 2, 4, 8, 16, 32, 64, 128, 255, 511, 1013, 2026, 4007, 7969, 15728, 31081, 61127, 120063, 234991, 458813, 892999, 1733063, 3352924, 6466805, 12432745, 23825009, 45552282, 86701276, 164516870, 311753791, 587855120, 1104493663, 2072926133, 3874661542
Offset: 0

Views

Author

Alois P. Heinz, May 29 2014

Keywords

Comments

Number of compositions of n avoiding the pattern {1}^9.

Crossrefs

Column k=8 of A243081.

Programs

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

A243087 Number of compositions of n into parts with multiplicity not larger than 9.

Original entry on oeis.org

1, 1, 2, 4, 8, 16, 32, 64, 128, 256, 511, 1023, 2036, 4072, 8089, 16123, 31971, 63447, 125464, 247848, 488248, 959954, 1882518, 3682966, 7186687, 13987505, 27151374, 52561888, 101473646, 195352782, 375197136, 718154110, 1370815210, 2611751010, 4957566835
Offset: 0

Views

Author

Alois P. Heinz, May 29 2014

Keywords

Comments

Number of compositions of n avoiding the pattern {1}^10.

Crossrefs

Column k=9 of A243081.

Programs

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