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.

A330460 Triangle read by rows where T(n,k) is the number of set partitions with k blocks and total sum n.

Original entry on oeis.org

1, 0, 1, 0, 1, 0, 0, 2, 1, 0, 0, 2, 1, 0, 0, 0, 3, 2, 0, 0, 0, 0, 4, 5, 1, 0, 0, 0, 0, 5, 6, 1, 0, 0, 0, 0, 0, 6, 9, 2, 0, 0, 0, 0, 0, 0, 8, 13, 3, 0, 0, 0, 0, 0, 0, 0, 10, 23, 10, 1, 0, 0, 0, 0, 0, 0, 0, 12, 27, 11, 1, 0, 0, 0, 0, 0, 0, 0, 0, 15, 40, 19, 2, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 0

Views

Author

Gus Wiseman, Dec 18 2019

Keywords

Examples

			Triangle begins:
  1
  0  1
  0  1  0
  0  2  1  0
  0  2  1  0  0
  0  3  2  0  0  0
  0  4  5  1  0  0  0
  0  5  6  1  0  0  0  0
  0  6  9  2  0  0  0  0  0
  0  8 13  3  0  0  0  0  0  0
  0 10 23 10  1  0  0  0  0  0  0
  0 12 27 11  1  0  0  0  0  0  0  0
  0 15 40 19  2  0  0  0  0  0  0  0  0
Row n = 8 counts the following set partitions:
  {{8}}      {{1},{7}}    {{1},{2},{5}}
  {{3,5}}    {{2},{6}}    {{1},{3},{4}}
  {{2,6}}    {{3},{5}}
  {{1,7}}    {{1},{3,4}}
  {{1,3,4}}  {{1},{2,5}}
  {{1,2,5}}  {{2},{1,5}}
             {{3},{1,4}}
             {{4},{1,3}}
             {{5},{1,2}}
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i, k) option remember; `if`(i*(i+1)/2 k*
             b(n-i, t, k)+b(n-i, t, k+1))(min(n-i, i-1))))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..n))(b(n$2, 0)):
    seq(T(n), n=0..15);  # Alois P. Heinz, Dec 29 2019
  • Mathematica
    ppl[n_,k_]:=Switch[k,0,{n},1,IntegerPartitions[n],_,Join@@Table[Union[Sort/@Tuples[ppl[#,k-1]&/@ptn]],{ptn,IntegerPartitions[n]}]];
    Table[Length[Select[ppl[n,2],Length[#]==k&&And[UnsameQ@@#,UnsameQ@@Join@@#]&]],{n,0,10},{k,0,n}]
    (* Second program: *)
    b[n_, i_, k_] := b[n, i, k] = If[i(i+1)/2 < n, 0, If[n == 0, x^k, b[n, i-1, k] + Function[t, k*b[n-i, t, k] + b[n-i, t, k + 1]][Min[n-i, i-1]]]];
    T[n_] := PadRight[CoefficientList[b[n, n, 0], x], n + 1];
    T /@ Range[0, 15] // Flatten (* Jean-François Alcover, May 16 2021, after Alois P. Heinz *)
  • PARI
    A(n)={my(v=Vec(prod(k=1, n, 1 + x^k*y + O(x*x^n)))); vector(#v, n, my(p=v[n]); vector(n, k, sum(i=k, n, polcoef(p,i-1)*stirling(i-1, k-1, 2))))}
    {my(T=A(12)); for(n=1, #T, print(T[n]))} \\ Andrew Howroyd, Dec 29 2019

Formula

T(n,k) = Sum_{k <= i <= n} A060016(n,i) * A008277(i,k).
For n > 0, T(n,2) = Sum_{k = 1..n} (2^(k - 1) -1) * A060016(n,k).