A327448 Number of ways the first n cubes can be partitioned into three sets with equal sums.
1, 0, 0, 691, 3416, 0, 233, 1168, 0, 8857, 18157, 0, 2176512, 3628118, 0, 3204865, 8031495, 0, 79514209, 205927212, 0, 5152732369, 13493840291, 0
Offset: 23
Examples
The unique smallest solution (for n = 23) is 27 + 216 + 1000 + 2197 + 5832 + 6859 + 9261 = 1 + 64 + 343 + 512 + 1728 + 4096 + 8000 + 10648 = 8 + 125 + 729 + 1331 + 2744 + 3375 + 4913 + 12167.
References
- Keith F. Lynch, Posting to Math Fun Mailing List, Sep 17 2019.
Programs
-
Maple
s:= proc(n) option remember; `if`(n<2, 0, n^3+s(n-1)) end: b:= proc(n, x, y) option remember; `if`(n=1, 1, (p-> (l-> add(`if`(p>l[i], 0, b(n-1, sort(subsop(i=l[i]-p, l)) [1..2][])), i=1..3))([x, y, s(n)-x-y]))(n^3)) end: a:= n-> `if`(irem(1+s(n), 3, 'q')=0, b(n, q-1, q)/2, 0): seq(a(n), n=23..27); # Alois P. Heinz, Sep 30 2019
-
Mathematica
s[n_] := s[n] = If[n < 2, 0, n^3 + s[n - 1]]; b[n_, x_, y_] := b[n, x, y] = If[n == 1, 1, With[{p = n^3}, Sum[If[p > #[[i]], 0, b[n - 1, Sequence @@ Sort[ReplacePart[#, i -> #[[i]] - p]][[1 ;; 2]]]], {i, 1, 3}]]&[{x, y, s[n] - x - y}]]; a[n_] := a[n] = If[q = Quotient[1 + s[n], 3]; Mod[1 + s[n], 3] == 0, b[n, q - 1, q]/2, 0]; Table[Print[n, " ", a[n]]; a[n], {n, 23, 34}] (* Jean-François Alcover, Nov 08 2020, after Alois P. Heinz *)
Formula
a(n) > 0 => n in { A007494 }. - Alois P. Heinz, Sep 30 2019
Extensions
a(32), a(33), a(35) recomputed and a(36)-a(38) added by Alois P. Heinz, Sep 30 2019
a(39)-a(46) from Bert Dobbelaere, May 15 2021
Comments