|
|
A331843
|
|
Number of compositions (ordered partitions) of n into distinct triangular numbers.
|
|
14
|
|
|
1, 1, 0, 1, 2, 0, 1, 2, 0, 2, 7, 2, 0, 2, 6, 1, 4, 6, 2, 12, 24, 3, 8, 0, 8, 32, 6, 2, 13, 26, 6, 34, 36, 0, 32, 150, 3, 20, 50, 14, 54, 126, 32, 32, 12, 55, 160, 78, 122, 44, 174, 4, 72, 294, 36, 201, 896, 128, 62, 180, 176, 164, 198, 852, 110, 320, 159, 212, 414
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,5
|
|
LINKS
|
|
|
EXAMPLE
|
a(10) = 7 because we have [10], [6, 3, 1], [6, 1, 3], [3, 6, 1], [3, 1, 6], [1, 6, 3] and [1, 3, 6].
|
|
MAPLE
|
h:= proc(n) option remember; `if`(n<1, 0,
`if`(issqr(8*n+1), 1+h(n-1), h(n-1)))
end:
b:= proc(n, i, p) option remember; (t->
`if`(t*(i+2)/3<n, 0, `if`(n=0, p!, b(n, i-1, p)+
`if`(t>n, 0, b(n-t, i-1, p+1)))))((i*(i+1)/2))
end:
a:= n-> b(n, h(n), 0):
|
|
MATHEMATICA
|
h[n_] := h[n] = If[n<1, 0, If[IntegerQ @ Sqrt[8n+1], 1 + h[n-1], h[n-1]]];
b[n_, i_, p_] := b[n, i, p] = Function[t, If[t (i + 2)/3 < n, 0, If[n == 0, p!, b[n, i-1, p] + If[t>n, 0, b[n - t, i - 1, p + 1]]]]][(i(i + 1)/2)];
a[n_] := b[n, h[n], 0];
|
|
CROSSREFS
|
Cf. A000217, A023361, A024940, A032020, A032021, A032022, A218396, A219107, A331844, A331845, A331846, A331847.
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|