login
Number T(n,k) of partitions of n into k positive cubes; triangle T(n,k), n >= 0, 0 <= k <= n, read by rows.
7

%I #37 Nov 08 2020 05:53:51

%S 1,0,1,0,0,1,0,0,0,1,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,

%T 0,1,0,1,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,1,0,0,

%U 0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1

%N Number T(n,k) of partitions of n into k positive cubes; triangle T(n,k), n >= 0, 0 <= k <= n, read by rows.

%H Alois P. Heinz, <a href="/A320841/b320841.txt">Rows n = 0..500, flattened</a>

%H <a href="/index/Su#ssq">Index entries for sequences related to sums of cubes</a>

%F T(n,k) = [x^n y^k] 1/Product_{j>=1} (1 - y*x^(j^3)).

%e Triangle begins:

%e 1;

%e 0, 1;

%e 0, 0, 1;

%e 0, 0, 0, 1;

%e 0, 0, 0, 0, 1;

%e 0, 0, 0, 0, 0, 1;

%e 0, 0, 0, 0, 0, 0, 1;

%e 0, 0, 0, 0, 0, 0, 0, 1;

%e 0, 1, 0, 0, 0, 0, 0, 0, 1;

%e 0, 0, 1, 0, 0, 0, 0, 0, 0, 1;

%e 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1;

%e 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1;

%e 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1;

%e ...

%p b:= proc(n, i, t) option remember; `if`(n=0, `if`(t=0, 1, 0),

%p `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 T:= (n, k)-> b(n, iroot(n, 3), k):

%p seq(seq(T(n, k), k=0..n), n=0..16); # _Alois P. Heinz_, Dec 21 2018

%t T[n_, k_] := Count[PowersRepresentations[n, k, 3], r_ /; FreeQ[r, 0]]; T[0, 0] = 1; Table[T[n, k], {n, 0, 14}, {k, 0, n}] // Flatten

%t (* Second program: *)

%t b[n_, i_, t_] := b[n, i, t] = If[n == 0, If[t == 0, 1, 0], If[i < 1 || t < 1, 0, b[n, i - 1, t] + If[i^3 > n, 0, b[n - i^3, i, t - 1]]]];

%t T[n_, k_] := b[n, n^(1/3) // Floor, k];

%t Table[T[n, k], {n, 0, 16}, {k, 0, n}] // Flatten (* _Jean-François Alcover_, Nov 08 2020, after _Alois P. Heinz_ *)

%Y Columns k=0..10 give A000007, A010057 (for n > 0), A025455, A025456, A025457, A025458, A025459, A025460, A025461, A025462, A025463.

%Y Row sums give A003108.

%Y Cf. A000578, A243148, A319797.

%K nonn,tabl

%O 0

%A _Ilya Gutkovskiy_, Dec 09 2018