OFFSET
0,6
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..4500
EXAMPLE
a(0) = 1: the empty composition.
a(1) = 1: [1].
a(4) = 1: [2,2].
a(5) = 3: [1,2,2], [2,1,2], [2,2,1].
a(9) = 1: [3,3,3].
a(10) = 4: [1,3,3,3], [3,1,3,3], [3,3,1,3], [3,3,3,1].
a(13) = 10: [2,2,3,3,3], [2,3,2,3,3], [2,3,3,2,3], [2,3,3,3,2], [3,2,2,3,3], [3,2,3,2,3], [3,2,3,3,2], [3,3,2,2,3], [3,3,2,3,2], [3,3,3,2,2].
MAPLE
b:= proc(n, i, p) option remember; `if`(n=0, p!, `if`(i<1, 0,
b(n, i-1, p) +`if`(i^2>n, 0, b(n-i^2, i-1, p+i)/i!)))
end:
a:= n-> b(n, isqrt(n), 0):
seq(a(n), n=0..100);
MATHEMATICA
b[n_, i_, p_] := b[n, i, p] = If[n==0, p!, If[i<1, 0, b[n, i-1, p] + If[i^2 >n, 0, b[n-i^2, i-1, p+i]/i!]]]; a[n_] := b[n, Floor[Sqrt[n]], 0]; Table[ a[n], {n, 0, 100}] (* Jean-François Alcover, Feb 08 2017, translated from Maple *)
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Alois P. Heinz, May 14 2014
STATUS
approved