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.

A196231 Irregular triangle T(n,k), n>=1, 1<=k<=ceiling(n/2), read by rows: T(n,k) is the number of different ways to select k disjoint (nonempty) subsets from {1..n} with equal element sum.

Original entry on oeis.org

1, 3, 7, 1, 15, 3, 31, 7, 1, 63, 17, 3, 127, 43, 8, 1, 255, 108, 22, 3, 511, 273, 63, 9, 1, 1023, 708, 157, 23, 3, 2047, 1867, 502, 67, 10, 1, 4095, 4955, 1562, 203, 26, 3, 8191, 13256, 4688, 693, 83, 11, 1, 16383, 35790, 15533, 2584, 322, 30, 3, 32767, 97340
Offset: 1

Views

Author

Alois P. Heinz, Sep 29 2011

Keywords

Examples

			T(8,4) = 3: {1,6}, {2,5}, {3,4}, {7} have element sum 7, {1,7}, {2,6}, {3,5}, {8} have element sum 8, and {1,8}, {2,7}, {3,6}, {4,5} have element sum 9.
Triangle begins:
.   1;
.   3;
.   7,   1;
.  15,   3;
.  31,   7,  1;
.  63,  17,  3;
. 127,  43,  8, 1;
. 255, 108, 22, 3;
		

Crossrefs

Columns k=1-10 give: A000225, A161943, A164934, A164949, A196232, A196233, A196234, A196235, A196236, A196237. Row sums give A196534. Row lengths are in A110654.

Programs

  • Maple
    b:= proc(l, n, k) option remember; local i, j; `if`(l=[0$k], 1, `if`(add(j, j=l)>n*(n-1)/2, 0, b(l, n-1, k))+ add(`if`(l[j] -n<0, 0, b(sort([seq(l[i] -`if`(i=j, n, 0), i=1..k)]), n-1, k)), j=1..k)) end: T:= (n, k)-> add(b([t$k], n, k), t=2*k-1..floor(n*(n+1)/(2*k)))/k!:
    seq(seq(T(n, k), k=1..ceil(n/2)), n=1..15);
  • Mathematica
    b[l_List, n_, k_] := b[l, n, k] = Module[{i, j}, If[l == Array[0&, k], 1, If [Total[l] > n*(n-1)/2, 0, b[l, n-1, k]] + Sum [If [l[[j]] - n < 0, 0, b[Sort[Table[l[[i]] - If[i == j, n, 0], {i, 1, k}]], n-1, k]], {j, 1, k}]] ]; T[n_, k_] := Sum[b[Array[t&, k], n, k], {t, 2*k-1, Floor[n*(n+1)/(2*k)]}]/k!; Table[Table[T[n, k], {k, 1, Ceiling[n/2]}], {n, 1, 15}] // Flatten (* Jean-François Alcover, Dec 17 2013, translated from Maple *)