OFFSET
0,7
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..200
Wikipedia, Partition problem
FORMULA
a(n) = A083527(n) if n == 0 or 3 (mod 4).
EXAMPLE
a(6) = 2: 1,9,36/4,16,25; 1,4,16,25/9,36.
a(7) = 1: 1,4,16,49/9,25,36.
MAPLE
s:= proc(n) s(n):= `if`(n=0, 1, n^2+s(n-1)) end:
b:= proc(n, i) option remember; `if`(i=0, `if`(n<=1, 1, 0),
`if`(n>s(i), 0, (p-> b(n+p, i-1)+b(abs(n-p), i-1))(i^2)))
end:
a:= n-> ceil(b(0, n)/2):
seq(a(n), n=0..45);
MATHEMATICA
s[n_] := s[n] = If[n == 0, 1, n^2 + s[n - 1]];
b[n_, i_] := b[n, i] = If[i == 0, If[n <= 1, 1, 0], If[n > s[i], 0, Function[p, b[n + p, i - 1] + b[Abs[n - p], i - 1]][i^2]]];
a[n_] := Ceiling[b[0, n]/2];
a /@ Range[0, 45] (* Jean-François Alcover, Dec 07 2020, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Jun 04 2019
STATUS
approved