|
|
A331844
|
|
Number of compositions (ordered partitions) of n into distinct squares.
|
|
18
|
|
|
1, 1, 0, 0, 1, 2, 0, 0, 0, 1, 2, 0, 0, 2, 6, 0, 1, 2, 0, 0, 2, 6, 0, 0, 0, 3, 8, 0, 0, 8, 30, 0, 0, 0, 2, 6, 1, 2, 6, 24, 2, 8, 6, 0, 0, 8, 30, 0, 0, 7, 32, 24, 2, 8, 30, 120, 6, 24, 2, 6, 0, 8, 36, 24, 1, 34, 150, 0, 2, 12, 30, 24, 0, 2, 38, 150, 0, 12, 78, 144, 2
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,6
|
|
LINKS
|
|
|
EXAMPLE
|
a(14) = 6 because we have [9,4,1], [9,1,4], [4,9,1], [4,1,9], [1,9,4] and [1,4,9].
|
|
MAPLE
|
b:= proc(n, i, p) option remember;
`if`(i*(i+1)*(2*i+1)/6<n, 0, `if`(n=0, p!,
`if`(i^2>n, 0, b(n-i^2, i-1, p+1))+b(n, i-1, p)))
end:
a:= n-> b(n, isqrt(n), 0):
|
|
MATHEMATICA
|
b[n_, i_, p_] := b[n, i, p] = If[i(i+1)(2i+1)/6 < n, 0, If[n == 0, p!, If[i^2 > n, 0, b[n - i^2, i - 1, p + 1]] + b[n, i - 1, p]]];
a[n_] := b[n, Sqrt[n] // Floor, 0];
|
|
CROSSREFS
|
Cf. A000290, A006456, A032020, A032021, A032022, A033461, A218396, A219107, A331843, A331845, A331846, A331847.
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|