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
KEYWORD
easy,nonn
AUTHOR
Giovanni Teofilatto, Dec 31 2004
EXTENSIONS
Corrected and extended by T. D. Noe, Jan 01 2005
STATUS
approved