
MATHEMATICA

m = 6;
r[n_] := Reduce[xx = Array[x, m]; 0 <= x[1] && LessEqual @@ xx && AllTrue[xx, Positive] && n == Total[xx^2], xx, Integers];
For[n = 0, n < 50, n++, rn = r[n]; If[rn[[0]] === And, Print[n, " ", rn]]] (* JeanFrançois Alcover, Feb 25 2019 *)
b[n_, i_, k_, t_] := b[n, i, k, t] = If[n == 0, If[t == 0, 1, 0], If[i<1  t<1, 0, b[n, i  1, k, t] + If[i^2 > n, 0, b[n  i^2, i, k, t  1]]]];
T[n_, k_] := b[n, Sqrt[n] // Floor, k, k];
Position[Table[T[n, 6], {n, 0, 100}], 1]  1 // Flatten (* JeanFrançois Alcover, Nov 06 2020, after Alois P. Heinz in A243148 *)
