OFFSET
0,6
LINKS
EXAMPLE
a(14) = 6 because we have [9,4,1], [9,1,4], [4,9,1], [4,1,9], [1,9,4] and [1,4,9].
MAPLE
b:= proc(n, i, p) option remember;
`if`(i*(i+1)*(2*i+1)/6<n, 0, `if`(n=0, p!,
`if`(i^2>n, 0, b(n-i^2, i-1, p+1))+b(n, i-1, p)))
end:
a:= n-> b(n, isqrt(n), 0):
seq(a(n), n=0..82); # Alois P. Heinz, Jan 30 2020
MATHEMATICA
b[n_, i_, p_] := b[n, i, p] = If[i(i+1)(2i+1)/6 < n, 0, If[n == 0, p!, If[i^2 > n, 0, b[n - i^2, i - 1, p + 1]] + b[n, i - 1, p]]];
a[n_] := b[n, Sqrt[n] // Floor, 0];
a /@ Range[0, 82] (* Jean-François Alcover, Oct 29 2020, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Ilya Gutkovskiy, Jan 29 2020
STATUS
approved