login
A100499
Smallest cube that is the sum of n positive squares.
1
1, 8, 27, 27, 8, 27, 27, 8, 27, 27, 27, 27, 27, 64, 27, 27, 64, 27, 27, 64, 27, 64, 64, 27, 64, 64, 27, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 125, 64, 64, 125, 64, 64, 125, 64, 125, 125, 64, 125, 125, 64, 125, 125, 125, 125
OFFSET
1,2
COMMENTS
It appears that for n in [k^3+1,(k+1)^3], a(n) is either (k+1)^3 or (k+2)^3. The Mathematica code uses backtracking to find the least cube for each n. - T. D. Noe, Jan 03 2005
EXAMPLE
Here are the initial solutions: cube = {list of n numbers whose squares sum to the smallest cube}:
1 = {1}
8 = {2, 2}
27 = {1, 1, 5}
27 = {1, 1, 3, 4}
8 = {1, 1, 1, 1, 2}
27 = {1, 1, 1, 2, 2, 4}
27 = {1, 1, 2, 2, 2, 2, 3}
8 = {1, 1, 1, 1, 1, 1, 1, 1}
27 = {1, 1, 1, 1, 1, 1, 1, 2, 4}
MATHEMATICA
$RecursionLimit=1000; try2[lev_] := Module[{t, j, ss}, ss=Plus@@(Take[soln, lev-1]^2); If[lev>n, If[ss<=sumMax&&IntegerQ[ss^(1/3)]&&ss<minSum, minSum=ss; bestSoln={ss, soln}], If[lev==1, t=1, t=soln[[lev-1]]]; j=t; While[ss+(n-lev+1)*j^2<=sumMax, soln[[lev]]=j; try2[lev+1]; soln[[lev]]=t; j++ ]]]; Table[minSum=Infinity; bestSoln={}; sumMax=(Ceiling[n^(1/3)]+1)^3; soln=Table[1, {n}]; try2[1]; bestSoln[[1]], {n, 100}]
CROSSREFS
Cf. A102313 (least k such that k^3 is the sum of n positive squares).
Sequence in context: A070721 A070501 A070500 * A070499 A077107 A335018
KEYWORD
easy,nonn
AUTHOR
Giovanni Teofilatto, Dec 31 2004
EXTENSIONS
Corrected and extended by T. D. Noe, Jan 01 2005
STATUS
approved