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-17 of 17 results.

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

A072576 Limit of number of compositions (ordered partitions) of m into distinct parts where largest part is exactly m-n, for m sufficiently large given n.

Original entry on oeis.org

1, 2, 2, 8, 8, 14, 38, 44, 68, 98, 242, 272, 440, 590, 878, 1772, 2180, 3194, 4466, 6320, 8432, 16190, 19262, 28580, 38276, 54314, 70730, 99152, 163328, 204230, 286670, 386132, 527132, 695978, 941738, 1220984, 1950128, 2390294, 3321398, 4342148, 5929532, 7616642, 10284410
Offset: 0

Views

Author

Henry Bottomley, Jun 21 2002

Keywords

Comments

Consider an ordered 1 X n tiling of white tiles whose lengths are all distinct from each other, and whose sum is n. Now introduce into this tiling a red square. The resulting number of compositions is a(n). - Gregory L. Simay, Oct 25 2019

Examples

			a(3) = 8 because for any m > 6 the number of compositions of e.g. m=7 into distinct parts where the largest part is exactly m-3 = 7-3 = 4 is eight, 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.
Note that in the example immediately above, 4 corresponds to the red square, since it is greater than--and therefore distinct from--parts 1,2 and 3, which correspond to the distinct white tiles. More generally, for the compositions of n having all parts distinct, the red square must correspond to a positive integer > n in order for the number of resulting compositions to be a(n). - _Gregory L. Simay_, Oct 25 2019
		

Crossrefs

Cf. A072575.
Cf. A032020. - Alois P. Heinz, Dec 12 2012

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! * l[i], i=1..nops(l)) end:
    seq(a(n), n=0..50);  # Alois P. Heinz, Dec 12 2012
  • Mathematica
    b[n_, i_] := If[n == 0, {1}, If[i<1, {}, Plus @@ PadRight[{b[n, i-1], If[i>n, {}, Prepend[b[n-i, i-1], 0]]}]]]; a[n_] := Module[{l}, l = b[n, n]; Sum[i!*l[[i]], {i, 1, Length[l]}]]; Table[a[n], {n, 0, 50}] (* Jean-François Alcover, Jan 31 2014, after Alois P. Heinz *)
  • PARI
    N=66;  q='q+O('q^N);
    gf=sum(n=0,N, (n+1)!*q^(n*(n+1)/2) / prod(k=1,n, 1-q^k ) );
    Vec(gf)
    /* Joerg Arndt, Oct 20 2012 */

Formula

a(n) = Sum_k (k+1)! * A060016(n,k) = Sum_k (k+1) * A072574(n,k).
a(n) = Sum_k (k+1)! * A008289(n,k). - Alois P. Heinz, Dec 12 2012

A330461 Array read by antidiagonals where A(n,k) is the number of multiset partitions with k levels that are strict at all levels and have total sum n.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 3, 1, 1, 1, 1, 3, 4, 4, 1, 1, 1, 1, 4, 7, 7, 5, 1, 1, 1, 1, 5, 12, 14, 11, 6, 1, 1, 1, 1, 6, 19, 29, 25, 16, 7, 1, 1, 1, 1, 8, 30, 57, 60, 41, 22, 8, 1, 1, 1, 1, 10, 49, 110, 141, 111, 63, 29, 9, 1, 1, 1
Offset: 0

Views

Author

Gus Wiseman, Dec 18 2019

Keywords

Examples

			Array begins:
       k=0 k=1 k=2 k=3 k=4 k=5 k=6
      -----------------------------
  n=0:  1   1   1   1   1   1   1
  n=1:  1   1   1   1   1   1   1
  n=2:  1   1   1   1   1   1   1
  n=3:  1   2   3   4   5   6   7
  n=4:  1   2   4   7  11  16  22
  n=5:  1   3   7  14  25  41  63
  n=6:  1   4  12  29  60 111 189
For example, the A(5,3) = 14 partitions are:
  {{5}}      {{1}}{{4}}
  {{14}}     {{2}}{{3}}
  {{23}}     {{1}}{{13}}
  {{1}{4}}   {{2}}{{12}}
  {{2}{3}}   {{1}}{{1}{3}}
  {{1}{13}}  {{2}}{{1}{2}}
  {{2}{12}}  {{1}}{{1}{12}}
		

Crossrefs

Columns are A000012 (k = 0), A000009 (k = 1), A050342 (k = 2), A050343 (k = 3), A050344 (k = 4).
The non-strict version is A290353.

Programs

  • Mathematica
    spl[n_,0]:={n};
    spl[n_,k_]:=Select[Join@@Table[Union[Sort/@Tuples[spl[#,k-1]&/@ptn]],{ptn,IntegerPartitions[n]}],UnsameQ@@#&];
    Table[Length[spl[n-k,k]],{n,0,10},{k,0,n}]
  • PARI
    WeighT(v)={Vec(exp(x*Ser(dirmul(v, vector(#v,n,(-1)^(n-1)/n))))-1,-#v)}
    M(n, k=n)={my(L=List(), v=vector(n,i,1)); listput(L, concat([1], v)); for(j=1, k, v=WeighT(v); listput(L, concat([1], v))); Mat(Col(L))~}
    { my(A=M(7)); for(i=1, #A, print(A[i,])) } \\ Andrew Howroyd, Dec 31 2019

Formula

Column k is the k-th weigh transform of the all-ones sequence. The weigh transform of a sequence b has generating function Product_{i > 0} (1 + x^i)^b(i).

A070936 Square array read by antidiagonals: T(n,k) = number of partitions of n into distinct parts, each no more than k.

Original entry on oeis.org

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

Views

Author

Henry Bottomley, May 12 2002

Keywords

Examples

			Rows start
1,1,1,1,1,...;
0,1,1,1,1,...;
0,0,1,1,1,...;
0,0,1,2,2,...;
0,0,0,1,2,...; etc.
T(10,5)=3 since 10 can be partitioned 3 ways as 5+4+1=5+3+2=4+3+2+1 with each part less than or equal to 5.
		

Crossrefs

Cf. A008284, A060016. With some imagination, this is the transpose of A026836 and A053632. Column sums are 2^k=A000079(k). Column maximum is A025591(k), which appears A070936(k) times in the column.

Formula

T(n, k) =T(n-1, k)+T(n-1, k-n) (with T(0, 0)=1) =A053632(k, n) =A026836(n+k+1, k+1) =sum_{0<=j<=k}A026836(n, j). For k>=n, T(n, k)=T(n, n)=A000009(n).

A360072 Number of pairs of positive integers (k,i) such that k >= i and there exists an integer partition of n of length k with i distinct parts.

Original entry on oeis.org

0, 1, 2, 3, 5, 5, 9, 9, 13, 14, 18, 19, 26, 25, 30, 34, 39, 40, 48, 48, 56, 59, 64, 67, 78, 78, 84, 89, 97, 99, 111, 111, 121, 125, 131, 137, 149, 149, 158, 165, 176, 177, 190, 191, 202, 210, 216, 222, 238, 239, 250, 256, 266, 270, 284, 289, 302, 307, 316, 323
Offset: 0

Views

Author

Gus Wiseman, Jan 28 2023

Keywords

Comments

This is the number of nonzero terms in the n-th triangle of A360071.

Examples

			The a(5) = 5 pairs are: (1,1), (2,2), (3,2), (4,2), (5,1). The pair (3,3) is absent because it is not possible to partition 5 into 3 parts, all 3 of which are distinct.
The a(6) = 9 pairs are: (1,1), (2,1), (2,2), (3,1), (3,2), (3,3), (4,2), (5,2), (6,1). The pair (3,3) is present because (3,2,1) is a partition of 6 into 3 parts, all 3 of which are distinct.
		

Crossrefs

A000041 counts integer partitions, strict A000009.
A008284 counts partitions by number of parts, reverse A058398.
A116608 counts partitions by number of distinct parts.

Programs

  • Mathematica
    Table[Count[Flatten[Sign[Table[Length[Select[IntegerPartitions[n], Length[#]==k&&Length[Union[#]]==i&]],{k,1,n},{i,1,k}]]],1],{n,0,30}]
  • PARI
    a(n) = if(n < 1, 0, numdiv(n) + sum(k=2, (sqrtint(8*n+1)-1)\2, n-binomial(k+1,2)+1)) \\ Andrew Howroyd, Jan 30 2023

Formula

a(n) = A000005(n) + Sum_{k=2..floor((sqrt(8*n+1)-1)/2)} (1 + n - binomial(k+1,2)) for n > 0. - Andrew Howroyd, Jan 30 2023

Extensions

Terms a(31) and beyond from Andrew Howroyd, Jan 30 2023

A385374 a(n) is the number of partitions of n into tau(n) distinct parts.

Original entry on oeis.org

1, 0, 1, 0, 2, 0, 3, 0, 3, 1, 5, 0, 6, 5, 6, 1, 8, 0, 9, 0, 27, 34, 11, 0, 40, 64, 72, 14, 14, 0, 15, 44, 150, 169, 185, 0, 18, 249, 270, 5, 20, 11, 21, 454, 532, 478, 23, 0, 176, 1057, 672, 1360, 26, 288, 864, 434, 972, 1033, 29, 0, 30, 1285, 4494, 4011, 1495
Offset: 1

Views

Author

Felix Huber, Jul 06 2025

Keywords

Examples

			a(14) = 5 because there are 5 partitions of 14 into tau(14) = 4 distinct parts: [1, 2, 3, 8], [1, 2, 4, 7], [1, 2, 5, 6], [1, 3, 4, 6], [2, 3, 4, 5].
		

Crossrefs

Subsequence of A060016.

Programs

  • Maple
    b:= proc(n,i,k)
        option remember;
        if n=0 and k=0 then
            return 1
        elif n=0 or k=0 or i<1 then
            return 0
        elif i<=n then
            return b(n,i-1,k)+b(n-i,i-1,k-1)
        else
            return b(n,i-1,k)
        fi;
    end proc:
    A385374:=n->b(n,n,NumberTheory:-tau(n));
    seq(A385374(n),n=1..65);
  • Mathematica
    a[n_]:=Length[Select[Union/@IntegerPartitions[n,{DivisorSigma[0,n]}],Length[#]==DivisorSigma[0,n]&]];Array[a,65] (* James C. McMahon, Jul 11 2025 *)

A360670 Number of integer partitions of n whose parts have the same mean as their negated first differences.

Original entry on oeis.org

1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 2, 0, 0, 1, 2, 0, 2, 0, 2, 2, 0, 0, 5, 1, 0, 3, 3, 0, 4, 0, 5, 3, 0, 2, 10, 0, 0, 4, 10, 0, 5, 0, 7, 9, 0, 0, 17, 1, 6, 5, 10, 0, 9, 8, 14, 6, 0, 0, 34, 0, 0, 9, 18, 13, 13, 0, 17, 7, 19, 0, 40, 0, 0, 28
Offset: 0

Views

Author

Gus Wiseman, Feb 18 2023

Keywords

Examples

			The a(n) partitions for n = 4, 12, 24, 27, 30, 44:
  (3,1)  (9,3)    (18,6)      (19,7,1)  (21,8,1)      (33,11)
         (9,2,1)  (17,6,1)    (20,5,2)  (22,6,2)      (34,5,4,1)
                  (18,4,2)    (21,3,3)  (23,4,3)      (34,6,3,1)
                  (19,2,2,1)            (25,2,1,1,1)  (34,7,2,1)
                  (19,3,1,1)                          (34,8,1,1)
                                                      (35,4,3,2)
                                                      (35,5,2,2)
For example, the partition y = (28,4,3,1), with mean 9, has negated first differences (24,2,1), with mean 9, so y is counted under a(36).
		

Crossrefs

These partitions have ranks A360669.
A000041 counts integer partitions, strict A000009.
A058398 counts partitions by mean, see also A008284, A327482.
A067538 counts partitions with integer mean, strict A102627, ranks A316413.
A326567/A326568 gives mean of prime indices.
A360614/A360615 = mean of first differences of 0-prepended prime indices.

Programs

  • Mathematica
    Table[Length[Select[IntegerPartitions[n], Mean[#]==Mean[Differences[Reverse[#]]]&]],{n,0,30}]
Previous Showing 11-17 of 17 results.