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.

A138774 Triangle read by rows: T(n,k) is the number of partitions of k that fit into a 2n by n box (n>=0; 0<=k<=2n^2).

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 2, 2, 3, 2, 2, 1, 1, 1, 1, 2, 3, 4, 5, 7, 7, 8, 8, 8, 7, 7, 5, 4, 3, 2, 1, 1, 1, 1, 2, 3, 5, 6, 9, 11, 15, 17, 21, 23, 27, 28, 31, 31, 33, 31, 31, 28, 27, 23, 21, 17, 15, 11, 9, 6, 5, 3, 2, 1, 1, 1, 1, 2, 3, 5, 7, 10, 13, 18, 23, 30, 36, 45, 53, 63, 72, 83, 92, 103, 111, 121
Offset: 0

Views

Author

Emeric Deutsch, May 03 2008

Keywords

Comments

Row n contains 1+2n^2 terms.
Sum of entries in row n is binomial(3n,n) (=A005809(n)).
Also, number of n-multisets in [0..2n] whose elements sum up to k. M. F. Hasler, Apr 15 2012

Examples

			T(2,4)=3 because we have 4, 31 and 22.
T(3,13)=5 because we have 661,652,643,553 and 544.
Triangle starts:
1;
1,1,1;
1,1,2,2,3,2,2,1,1;
1,1,2,3,4,5,7,7,8,8,8,7,7,5,4,3,2,1,1;
		

References

  • G. E. Andrews and K. Eriksson, Integer partitions, Cambridge Univ. Press, 2004, pp. 67-69.

Crossrefs

Programs

  • Maple
    br:=proc(n) options operator, arrow: sum(q^i,i=0..n-1) end proc: f:= proc(n) options operator, arrow: mul(br(j),j=1..n) end proc: cbr:=proc(n,k) options operator, arrow: simplify(f(n)/(f(k)*f(n-k))) end proc: for n from 0 to 5 do P[n]:=sort(expand(cbr(3*n,n))) end do: for n from 0 to 5 do seq(coeff(P[n],q, j),j=0..2*n^2) end do; # yields sequence in triangular form
    # second Maple program:
    b:= proc(n, i, k) option remember;
          `if`(n=0, 1, `if`(i<1 or k<1, 0, b(n, i-1, k)+
          `if`(i>n, 0, b(n-i, i, k-1))))
        end:
    T:= n-> seq(b(k, min(n, k), 2*n), k=0..2*n^2):
    seq(T(n), n=0..6);  # Alois P. Heinz, Apr 05 2012
  • Mathematica
    b[n_, i_, k_] := b[n, i, k] = If[n == 0, 1, If[i<1 || k<1, 0, b[n, i-1, k] + If[i>n, 0, b[n-i, i, k-1]]]]; T[n_] := Table[b[k, Min[n, k], 2*n], {k, 0, 2 n^2}]; Table[T[n], {n, 0, 6}] // Flatten (* Jean-François Alcover, May 26 2015, after Alois P. Heinz *)
  • PARI
    T138774(n,k)=polcoeff(prod(i=0,2*n,sum(j=0,n,x^(j*(i*(2*n^2+n+1)+1)),O(x^(k*(2*n^2+n+1)+n+1)))),k*(2*n^2+n+1)+n) /* replacing the inner sum by the expression for the geometric series seems less efficient */
    for(n=0,5,for(k=0,2*n^2,print1(T138774(n,k)","))) \\ M. F. Hasler, Apr 15 2012

Formula

G.f. of row n = the q-binomial coefficient [3n,n].