login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A164949
Number of different ways to select 4 disjoint subsets from {1..n} with equal element sum.
9
0, 0, 0, 0, 0, 0, 1, 3, 9, 23, 67, 203, 693, 2584, 9929, 37480, 137067, 522854, 2052657, 8199728, 33456333, 137831268, 574295984, 2392149818, 9950364020, 41860671346, 177512155194, 757447761138, 3254519322231, 14049972380612, 60960849334377, 265354255338637
OFFSET
1,8
EXAMPLE
a(7) = 1, because {1,6}, {2,5}, {3,4}, {7} are disjoint subsets of {1..7} with element sum 7.
a(8) = 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.
MAPLE
b:= proc() option remember; local i, j; `if`(args[1]=0 and args[2]=0 and args[3]=0 and args[4]=0, 1, `if`(add(args[j], j=1..4)> args[5] *(args[5]-1)/2, 0, b(args[j]$j=1..4, args[5]-1)) +add(`if`(args[j] -args[5]<0, 0, b(sort([seq(args[i] -`if`(i=j, args[5], 0), i=1..4)])[], args[5]-1)), j=1..4)) end: a:= n-> add(b(k$4, n), k=7..floor(n*(n+1)/8)) /24: seq(a(n), n=1..20);
MATHEMATICA
b[l_, 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, 2k-1, Floor[n(n+1)/(2k)]}]/k!;
a[n_] := T[n, 4];
Array[a, 20] (* Jean-François Alcover, Jun 08 2018, after Alois P. Heinz's Maple code in A196231 *)
CROSSREFS
Column k=4 of A196231.
Sequence in context: A253244 A018044 A047045 * A146661 A004666 A196488
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Sep 01 2009
STATUS
approved