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];
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Sep 01 2009
STATUS
approved