OFFSET
0,4
LINKS
EXAMPLE
a(9) = 6 because we have [8, 1], [7, 2], [5, 4], [4, 5], [2, 7] and [1, 8].
MAPLE
b:= proc(n, i, p) option remember; `if`(i*(i+1)/2<n, 0, `if`(n=0,
p!, add(b(n-i*j, i-1, p+j), j=0..min(irem(i, 3), 1, n/i))))
end:
a:= n-> b(n$2, 0):
seq(a(n), n=0..55); # Alois P. Heinz, Feb 09 2020
MATHEMATICA
b[n_, i_, p_] := b[n, i, p] = If[i(i+1)/2 < n, 0, If[n == 0, p!, Sum[b[n - i j, i - 1, p + j], {j, 0, Min[Mod[i, 3], 1, n/i]}]]];
a[n_] := b[n, n, 0];
a /@ Range[0, 55] (* Jean-François Alcover, Nov 09 2020, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Ilya Gutkovskiy, Feb 09 2020
STATUS
approved