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”).
%I #31 Dec 04 2020 15:57:31
%S 0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,137,211,0,0,0,3035,0,0,0,120465,
%T 259383,0,0,0,12328889,0,0,0,673380980,1659966694,0,0,0,69819104134,0,
%U 0,0,3761284888715,9660240745536,0,0,0,537238185892321,0,0,0,29922345673502904
%N Number of ways the first n squares can be partitioned into three sets with equal sums.
%D Keith F. Lynch, Posting to Math Fun Mailing List, Sep 19 2019.
%H Alois P. Heinz, <a href="/A327450/b327450.txt">Table of n, a(n) for n = 1..57</a>
%F a(n) > 0 => n in { A140282 }. - _Alois P. Heinz_, Sep 29 2019
%e The unique smallest solution (for n = 13) is 1 + 9 + 25 + 36 + 81 + 121 = 16 + 49 + 64 + 144 = 4 + 100 + 169.
%p s:= proc(n) option remember; `if`(n<2, 0, n^2+s(n-1)) end:
%p b:= proc(n, x, y) option remember; `if`(n=1, 1, (p-> (l->
%p add(`if`(p>l[i], 0, b(n-1, sort(subsop(i=l[i]-p, l))
%p [1..2][])), i=1..3))([x, y, s(n)-x-y]))(n^2))
%p end:
%p a:= n-> `if`(irem(1+s(n), 3, 'q')=0, b(n, q-1, q)/2, 0):
%p seq(a(n), n=1..27); # _Alois P. Heinz_, Sep 29 2019
%t s[n_] := s[n] = If[n < 2, 0, n^2 + s[n - 1]];
%t b[n_, x_, y_] := b[n, x, y] = Module[{p, l}, If[n == 1, 1, p = n^2; l = {x, y, s[n] - x - y}; Sum[If[p > l[[i]], 0, b[n - 1, Sequence @@ Sort[ ReplacePart[l, i -> l[[i]] - p]][[1 ;; 2]]]], {i, 1, 3}]]];
%t a[n_] := Module[{q, r}, {q, r} = QuotientRemainder[1 + s[n], 3]; If[r == 0, b[n, q - 1, q]/2, 0]];
%t Array[a, 30] (* _Jean-François Alcover_, Dec 04 2020, after _Alois P. Heinz_ *)
%Y Cf. A000290, A000330, A112972, A140282, A275714, A113263, A327448, A327449.
%K nonn
%O 1,17
%A _N. J. A. Sloane_, Sep 20 2019
%E a(28)-a(45) from _Alois P. Heinz_, Sep 29 2019
%E a(46)-a(53) from _Alois P. Heinz_, Oct 05 2019