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.

A248112 Number T(n,k) of subsets of {1,...,n} containing n and having at least one set partition into k blocks with equal element sum; triangle T(n,k), n>=1, 1<=k<=floor((n+1)/2), read by rows.

Original entry on oeis.org

1, 2, 4, 1, 8, 2, 16, 4, 1, 32, 10, 2, 64, 20, 5, 1, 128, 44, 12, 2, 256, 93, 29, 6, 1, 512, 198, 63, 14, 2, 1024, 414, 146, 37, 7, 1, 2048, 864, 329, 88, 16, 2, 4096, 1788, 722, 218, 49, 8, 1, 8192, 3687, 1613, 515, 118, 19, 2, 16384, 7541, 3505, 1226, 313, 62, 9, 1
Offset: 1

Views

Author

Alois P. Heinz, Oct 01 2014

Keywords

Examples

			T(7,3) = 5: {2,3,4,5,7}-> 25/34/7, {1,3,4,6,7}-> 16/34/7, {1,2,5,6,7}-> 16/25/7, {1,2,3,5,6,7}-> 17/26/35, {2,3,4,5,6,7}-> 27/36/45.
T(8,4) = 2: {1,2,3,5,6,7,8}-> 17/26/35/8, {1,2,3,4,5,6,7,8}-> 18/27/36/45.
T(9,5) = 1: {1,2,3,5,6,7,8,9}-> 18/27/36/45/9.
Triangle T(n,k) begins:
01 :    1;
02 :    2;
03 :    4,   1;
04 :    8,   2;
05 :   16,   4,   1;
06 :   32,  10,   2;
07 :   64,  20,   5,  1;
08 :  128,  44,  12,  2;
09 :  256,  93,  29,  6,  1;
10 :  512, 198,  63, 14,  2;
11 : 1024, 414, 146, 37,  7, 1;
12 : 2048, 864, 329, 88, 16, 2;
		

Crossrefs

Programs

  • Maple
    b:= proc(l, i) option remember; local k, r, j;
          k, r:= nops(l), {};
          if i*(i+1)/2 < l[-1]*k-add(j, j=l) then r
        elif i=0 then {r}
        else for j to k do r:= r union map(y->y union {i}, b((p->
               map(x->x-p[1], p))(sort(subsop(j=l[j]+i, l))), i-1))
             od;
             r union b(l, i-1)
          fi
        end:
    A:= (n, k)-> `if`(k=1, 2^(n-1), nops(b([0$(k-1), n], n-1))):
    seq(seq(A(n, k), k=1..iquo(n+1, 2)), n=1..15);
  • Mathematica
    b[l_, i_] := b[l, i] = Module[{k, r, j}, {k, r} = {Length[l], {}}; Which[ i*(i+1)/2 < l[[-1]]*k - Total[l], r, i == 0, {r}, True, For[j = 1, j <= k, j++, r = r ~Union~ Map[# ~Union~ {i}&, b[Function[p, Map[#-p[[1]]&, p] ][Sort[ReplacePart[l, j -> l[[j]]+i]]], i-1]]]; r ~Union~ b[l, i-1]]]; A[n_, k_] := If[k==1, 2^(n-1), Length[b[Append[Array[0&, (k-1)], n], n-1] ]]; Table[A[n, k], {n, 1, 15}, {k, 1, Quotient[n+1, 2]}] // Flatten (* Jean-François Alcover, Feb 03 2017, Translated from Maple *)