OFFSET
0,15
LINKS
EXAMPLE
a(55) = 120 because we have [25, 16, 9, 4, 1] (120 permutations).
MAPLE
b:= proc(n, i, p) option remember; `if`(n=0, irem(p, 2)*p!,
(s-> `if`(s>n, 0, b(n, i+1, p)+b(n-s, i+1, p+1)))(i^2))
end:
a:= n-> b(n, 1, 0):
seq(a(n), n=0..100); # Alois P. Heinz, Dec 04 2020
MATHEMATICA
b[n_, i_, p_] := b[n, i, p] = If[n == 0, Mod[p, 2]*p!, With[{s = i^2}, If[s > n, 0, b[n, i + 1, p] + b[n - s, i + 1, p + 1]]]];
a[n_] := b[n, 1, 0];
a /@ Range[0, 100] (* Jean-François Alcover, Mar 14 2021, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Ilya Gutkovskiy, Dec 04 2020
STATUS
approved