|
|
A339430
|
|
Number of compositions (ordered partitions) of n into an even number of distinct squares.
|
|
2
|
|
|
1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 2, 0, 0, 2, 0, 0, 0, 2, 0, 0, 2, 0, 0, 0, 0, 2, 2, 0, 0, 2, 24, 0, 0, 0, 2, 0, 0, 2, 0, 24, 2, 2, 0, 0, 0, 2, 24, 0, 0, 0, 26, 24, 2, 2, 24, 0, 0, 24, 2, 0, 0, 2, 24, 24, 0, 28, 24, 0, 2, 0, 24, 24, 0, 2, 26, 24, 0, 0, 72, 24, 2
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,6
|
|
LINKS
|
|
|
EXAMPLE
|
a(30) = 24 because we have [16, 9, 4, 1] (24 permutations).
|
|
MAPLE
|
b:= proc(n, i, p) option remember; `if`(n=0, irem(1+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):
|
|
MATHEMATICA
|
b[n_, i_, p_] := b[n, i, p] = If[n == 0, Mod[1 + 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];
|
|
CROSSREFS
|
|
|
KEYWORD
|
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|