%I #19 Nov 21 2020 16:17:26
%S 0,8,35,72,133,189,216,224,280,376,411,496,533,472,568,624,712,720,
%T 784,783,908,946,992,945,1062,1072,1081,1107,1153,1161,1224,1288,1376,
%U 1377,1449,1459,1547,1496,1504,1593,1592,1712,1719,1648,1783,1800,1837,1864
%N Smallest number expressible as a sum of 9 cubes (including 0) in n ways.
%H Alois P. Heinz, <a href="/A214725/b214725.txt">Table of n, a(n) for n = 1..1000</a>
%H Fred Richman, <a href="http://math.fau.edu/richman/Interesting/Sum9cubesList.htm">Lists the ways of writing i as a sum of 9 cubes (including 0)</a>
%e a(1) = 0: [0,0,0,0,0,0,0,0,0].
%e a(2) = 8: [0,0,0,0,0,0,0,0,2], [0,1,1,1,1,1,1,1,1].
%e a(3) = 35: [0,0,0,0,0,0,0,2,3], [0,0,1,1,1,2,2,2,2], [1,1,1,1,1,1,1,1,3].
%e a(7) = 216: [0,0,0,0,0,0,0,0,6], [0,1,1,1,2,2,2,4,5], [0,0,1,1,2,3,3,3,5], [1,2,2,3,3,3,3,3,4], [0,0,0,2,2,2,4,4,4], [0,3,3,3,3,3,3,3,3], [0,0,0,0,0,0,3,4,5].
%p b:= proc(n, i, t) option remember;
%p `if`(n=0, 1, `if`(i<1 or t<1, 0, b(n, i-1, t)+
%p `if`(i^3>n, 0, b(n-i^3, i, t-1))))
%p end:
%p a:= proc(n) local k;
%p for k from 0 while b(k, isqrt(k), 9)<>n do od; k
%p end:
%p seq(a(n), n=1..20); # _Alois P. Heinz_, Jul 26 2012
%t b[n_, i_, t_] := b[n, i, t] = If[n == 0, 1, If[i < 1 || t < 1, 0, b[n, i - 1, t] + If[i^3 > n, 0, b[n - i^3, i, t - 1]]]];
%t a[n_] := Module[{k}, For[k = 0, b[k, Floor@Sqrt[k], 9] != n, k++]; k];
%t Array[a, 20] (* _Jean-François Alcover_, Nov 21 2020, after _Alois P. Heinz_ *)
%K nonn
%O 1,2
%A _Claudio Meller_, Jul 26 2012
%E More terms from _Alois P. Heinz_, Jul 26 2012
|