%I #33 Dec 05 2020 14:19:10
%S 1,0,1,2,32,305,4331,63261,1025113,17495345,313692810,5838204047,
%T 112185853894,2213711510395,44691175805738,920173212324164,
%U 19274796589413439,409908483736507979,8835309887111026335,192739853119591626715,4250191938786946069812,94641409538083474973850
%N Number of partitions of {1,2,...,3n} into 3 n-element subsets having the same sum.
%C The element sum of each subset is n*(3*n+1)/2 = A005449(n).
%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Partition_of_a_set">Partition of a set</a>
%e a(0) = 1: {}, {}, {}.
%e a(1) = 0: there is no partition of {1,2,3} into 3 1-element subsets having the same sum.
%e a(2) = 1: {1,6}, {2,5}, {3,4}.
%e a(3) = 2: {1,5,9}, {2,6,7}, {3,4,8}; {1,6,8}, {2,4,9}, {3,5,7}.
%p b:= proc() option remember; local i, j, t, k, m; m:= args[nargs-1]; k:= args[nargs-0]; if args[1]=0 then `if`(nargs=3, 1, b(args[t]$t=2..nargs)) elif args[1]<1 then 0 else add(`if`(args[j]<m, 0, b(sort([seq(args[i] -`if`(i=j, m+1/97, 0), i=1..nargs-2)])[], m-1, k)), j=1..nargs-2) fi end:
%p a:= n-> b((n*(3*n+1)/2 +n/97)$3, 3*n, n)/`if`(n>0, 6, 1):
%p seq(a(n), n=0..10);
%t b[args_] := b[args] = Module[{nargs = Length[args], k = args[[-1]], m = args[[-2]]}, Which[args[[1]] == 0, If[nargs == 3, 1, b[args[[2 ;; nargs]] ]], args[[1]]<1, 0, True, Sum[If[args[[j]] < m, 0, b[Join[Sort[Table[ args[[i]] - If[i == j, m + 1/97, 0], {i, 1, nargs - 2}]], {m - 1, k}]]], {j, 1, nargs-2}]]];
%t A[n_, k_] := If[n == 0 || k == 0, 1, b[Join[Array[(k*(n*k + 1)/2 + k/97)&, n], {k*n, k}]]/n!];
%t a[k_] := A[3, k];
%t a /@ Range[0, 10] (* _Jean-François Alcover_, Dec 05 2020, after _Alois P. Heinz_ *)
%Y Row n=3 of A203986.
%Y Cf. A005449, A203435.
%K nonn
%O 0,4
%A _Alois P. Heinz_, Jan 06 2012
|