OFFSET
1,4
COMMENTS
A composition is gap-free but not complete if all integers in the interval defined by the smallest and the largest part are parts but 1 is not a part.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..1000
Alois P. Heinz, Plot of (a(n)+a(n+1)-a(n+2))/a(n+2) for n = 150..1000
P. Hitczenko and A. Knopfmacher, Gap-free compositions and gap-free samples of geometric random variables, Discrete Math., 294 (2005), 225-239.
EXAMPLE
a(6) = 3: [6], [3,3], [2,2,2].
a(7) = 6: [7], [3,4], [4,3], [2,2,3], [2,3,2], [3,2,2].
MAPLE
b:= proc(n, i, t) option remember; `if`(n=0, `if`(i=0, 0, t!),
`if`(i<1 or n<i, 0, add(b(n-i*j, i-1, t+j)/j!, j=1..n/i)))
end:
a:= n-> add(b(n, i, 0), i=1..n):
seq(a(n), n=1..50);
MATHEMATICA
b[n_, i_, t_] := b[n, i, t] = If[n == 0, If[i == 0, 0, t!], If[i < 1 || n < i, 0, Sum[b[n - i*j, i - 1, t + j]/j!, {j, 1, n/i}]]];
a[n_] := Sum[b[n, i, 0], {i, 1, n}];
Array[a, 50] (* Jean-François Alcover, Jan 25 2021, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Dec 07 2014
STATUS
approved