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

A180281 Triangle read by rows: T(n,k) = number of arrangements of n indistinguishable balls in n boxes with the maximum number of balls in any box equal to k.

Original entry on oeis.org

1, 1, 2, 1, 6, 3, 1, 18, 12, 4, 1, 50, 50, 20, 5, 1, 140, 195, 90, 30, 6, 1, 392, 735, 392, 147, 42, 7, 1, 1106, 2716, 1652, 672, 224, 56, 8, 1, 3138, 9912, 6804, 2970, 1080, 324, 72, 9, 1, 8952, 35850, 27600, 12825, 4950, 1650, 450, 90, 10, 1, 25652, 128865, 110715, 54450, 22022, 7865, 2420, 605, 110, 11
Offset: 1

Views

Author

R. H. Hardin, Aug 24 2010

Keywords

Comments

To clarify a slight ambiguity in the definition, the heaviest box in such an arrangement should contain exactly k balls. - Gus Wiseman, Sep 22 2016

Examples

			The T(4,2)=18 arrangements are {0022, 0112, 0121, 0202, 0211, 0220, 1012, 1021, 1102, 1120, 1201, 1210, 2002, 2011, 2020, 2101, 2110, 2200}.
Triangle starts
  1
  1   2
  1   6   3
  1  18  12  4
  1  50  50 20  5
  1 140 195 90 30 6
  ...
		

Crossrefs

Row sums give A088218.
T(n,ceiling(n/2)) gives A318160.
T(2n,n) gives A318161.
T(2n-1,n) gives A318161.

Programs

  • Maple
    b:= proc(n, i, k) option remember; `if`(n=0, 1,
          `if`(i=0, 0, add(b(n-j, i-1, k), j=0..min(n, k))))
        end:
    T:= (n, k)-> b(n$2, k)-b(n$2, k-1):
    seq(seq(T(n,k), k=1..n), n=1..12);  # Alois P. Heinz, Aug 16 2018
    # second Maple program:
    T:= (n, k)-> coeff(series(((x^(k+1)-1)/(x-1))^n
                 -((x^k-1)/(x-1))^n, x, n+1), x, n):
    seq(seq(T(n, k), k=1..n), n=1..12);  # Alois P. Heinz, Aug 17 2018
  • Mathematica
    T[n_,k_]:=Select[Tuples[Range[0,k],n],And[Max[#]===k,Total[#]===n]&]; (* Gus Wiseman, Sep 22 2016 *)
    SequenceForm@@@T[4,2] (* example *)
    Join@@Table[Length[T[n,k]],{n,1,6},{k,1,n}] (* sequence *)
    (* Second program: *)
    b[n_, i_, k_] := b[n, i, k] = If[n == 0, 1, If[i == 0, 0, Sum[b[n-j, i-1, k], {j, 0, Min[n, k]}]]];
    T[n_, k_] := b[n, n, k] - b[n, n, k-1];
    Table[Table[T[n, k], {k, 1, n}], {n, 1, 12}] // Flatten (* Jean-François Alcover, Aug 28 2022, after Alois P. Heinz *)

Formula

Empirical: right half of table, T(n,k) = n*binomial(2*n-k-2,n-2) for 2*k > n; also, T(n,2) = Sum_{j=1..n} binomial(n,j)*binomial(n-j,j) = 2*A097861(n). - Robert Gerbicz in the Sequence Fans Mailing List
From Alois P. Heinz, Aug 17 2018: (Start)
T(n,k) = [x^n] ((x^(k+1)-1)/(x-1))^n - ((x^k-1)/(x-1))^n.
T(n,k) = A305161(n,k) - A305161(n,k-1). (End)

A318161 Number of compositions of 2n into exactly 2n nonnegative parts with largest part n.

Original entry on oeis.org

1, 1, 18, 195, 1652, 12825, 96030, 705341, 5116200, 36773397, 262462010, 1862790699, 13160496684, 92624149475, 649794035142, 4545979700445, 31727803153232, 220975193536845, 1536191185018770, 10661898343645847, 73890140441316420, 511405029708269529
Offset: 0

Views

Author

Alois P. Heinz, Aug 19 2018

Keywords

Examples

			a(2) = 18: 0022, 0112, 0121, 0202, 0211, 0220, 1012, 1021, 1102, 1120, 1201, 1210, 2002, 2011, 2020, 2101, 2110, 2200.
		

Crossrefs

Bisection of A318160 (even part).
Cf. A180281.

Programs

  • Mathematica
    Flatten[{1, Table[n - 2*n^2 + 2*n*Binomial[3*n - 2, n], {n, 1, 20}]}] (* Vaclav Kotesovec, Sep 20 2019 *)

Formula

a(n) = A180281(2n,n).
For n>0, a(n) = n - 2*n^2 + 2*n*binomial(3*n - 2, n). - Vaclav Kotesovec, Sep 20 2019

A318162 Number of compositions of 2n-1 into exactly 2n-1 nonnegative parts with largest part n.

Original entry on oeis.org

1, 6, 50, 392, 2970, 22022, 160888, 1162800, 8335338, 59366450, 420630210, 2967563040, 20861295000, 146203657992, 1021964428880, 7127260128736, 49606676100234, 344658278690250, 2390849931605590, 16561583202364200, 114577083158683530, 791757148201073670
Offset: 1

Views

Author

Alois P. Heinz, Aug 19 2018

Keywords

Examples

			a(1) = 1: 1.
a(2) = 6: 012, 021, 102, 120, 201, 210.
a(3) = 50: 00023, 00032, 00113, 00131, 00203, 00230, 00302, 00311, 00320, 01013, 01031, 01103, 01130, 01301, 01310, 02003, 02030, 02300, 03002, 03011, 03020, 03101, 03110, 03200, 10013, 10031, 10103, 10130, 10301, 10310, 11003, 11030, 11300, 13001, 13010, 13100, 20003, 20030, 20300, 23000, 30002, 30011, 30020, 30101, 30110, 30200, 31001, 31010, 31100, 32000.
		

Crossrefs

Bisection of A318160 (odd part).
Cf. A180281.

Programs

  • Maple
    a:= proc(n) option remember; (2*n-1)*`if`(n<3, n,
          3*(3*n-4)*(3*n-5)*a(n-1)/(2*(n-1)*(2*n-3)^2))
        end:
    seq(a(n), n=1..30);
  • Mathematica
    Flatten[{1, Table[2*(2*n - 1)*Binomial[3*n - 4, n-2], {n, 2, 20}]}] (* Vaclav Kotesovec, Sep 20 2019 *)

Formula

a(n) = A180281(2n-1,n).
For n>1, a(n) = 2*(2*n - 1) * binomial(3*n - 4, n-2). - Vaclav Kotesovec, Sep 20 2019
Showing 1-3 of 3 results.