%I #32 Oct 30 2020 15:01:32
%S 0,0,0,0,1,1,0,3,9,0,43,102,0,595,1480,0,9294,23728,0,157991,411474,0,
%T 2849968,7562583,0,53987864,145173095,0,1061533318,2885383960,0,
%U 21515805520,59003023409,0,447142442841,1235311936936,0,9489835046489,26382363207307
%N Number of ways the set {1,2,...,n} can be split into three subsets of equal sums.
%H Alois P. Heinz, <a href="/A112972/b112972.txt">Table of n, a(n) for n = 1..125</a>
%F a(n) is 1/6 of the coefficient of x^0*y^0 in Product_{k=1..n} (x^(-2*k)+x^k*(y^k+y^(-k))).
%e For n=8 we have 84/75/6321, 84/732/651 and 831/75/642 so a(8)=3.
%p A112972:= n-> coeff(coeff(mul((x^(-2*k)+x^k*(y^k+y^(-k)))
%p , k=1..n), x, 0), y, 0)/6:
%p seq(A112972(n), n=1..20);
%p # second Maple program:
%p b:= proc() option remember; local i, j, t; `if`(args[1]=0,
%p `if`(nargs=2, 1, b(args[t] $t=2..nargs)), add(
%p `if`(args[j] -args[nargs]<0, 0, b(sort([seq(args[i]-
%p `if`(i=j, args[nargs], 0), i=1..nargs-1)])[],
%p args[nargs]-1)), j=1..nargs-1))
%p end:
%p a:= n-> (m-> `if`(irem(m, 3)=0, b((m/3)$3, n)/6, 0))(n*(n+1)/2):
%p seq(a(n), n=1..42); # _Alois P. Heinz_, Sep 03 2009
%t b[args_List] := b[args] = Module[{nargs = Length[args]}, If[args[[1]] == 0, If[nargs == 2, 1, b[args // Rest]], Sum[If[args[[j]] - Last[args] < 0, 0, b[Append[Sort[Flatten[Table[args[[i]] - If[i == j, Last[args], 0], {i, 1, nargs-1}]]], Last[args]-1]]], {j, 1, nargs-1}]]];
%t a[n_] := If[Mod[#, 3] == 0, b[{#/3, #/3, #/3, n}]/6, 0]&[n(n+1)/2];
%t Array[a, 42] (* _Jean-François Alcover_, Oct 30 2020, after _Alois P. Heinz_ *)
%Y Cf. A112956, A058377.
%Y Column k=3 of A275714.
%Y Similar sequences: A327448, A327449, A327450.
%K nonn
%O 1,8
%A _Floor van Lamoen_, Oct 07 2005
%E Extended beyond a(25) by _Alois P. Heinz_, Sep 03 2009