OFFSET
0,10
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..1000
EXAMPLE
a(9) = 2: [25,16,4], [36,9].
a(10) = 1: [25,16,9,4,1].
a(11) = 3: [36,16,9,4,1], [36,25,4,1], [49,16,1].
a(12) = 4: [36,25,16,1], [49,16,9,4], [49,25,4], [64,9,4,1]
MAPLE
b:= proc(n, i) option remember; (m-> `if`(n>m, 0,
`if`(n=m, 1, b(n, i-1)+ `if`(i^2>n, 0,
b(n-i^2, i-1)))))(i*(i+1)*(2*i+1)/6)
end:
a:= n-> (m-> b(m, isqrt(m)))(n*(n+1)/2):
seq(a(n), n=0..80);
MATHEMATICA
b[n_, i_] := b[n, i] = (If[n > #, 0, If[n == #, 1, b[n, i - 1] + If[i^2 > n, 0, b[n - i^2, i - 1]]]]) &[i*(i + 1)*(2*i + 1)/6];
a[n_] := b[#, Floor @ Sqrt[#]] &[n*(n + 1)/2];
Table[a[n], {n, 0, 30}] (* Jean-François Alcover, May 20 2018, translated from Maple *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Nov 18 2016
STATUS
approved