A336273 Number of compositions of n containing at least one part p of multiplicity p.
0, 1, 0, 2, 3, 5, 14, 28, 44, 101, 207, 399, 779, 1609, 3122, 6121, 11804, 23631, 46273, 91604, 178096, 352419, 691996, 1371306, 2702206, 5356324, 10604748, 21080216, 41869930, 83383786, 166114046, 331434088, 661685588, 1322042390, 2642367028, 5283397304
Offset: 0
Keywords
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..1000
Programs
-
Maple
b:= proc(n, i, p) option remember; `if`(n=0, p!, `if`(i<1, 0, add(`if`(i=j, 0, b(n-i*j, i-1, p+j)/j!), j=0..n/i))) end: a:= n-> ceil(2^(n-1))-b(n$2, 0): seq(a(n), n=0..40);
-
Mathematica
b[n_, i_, p_] := b[n, i, p] = If[n == 0, p!, If[i < 1, 0, Sum[If[i == j, 0, b[n - i*j, i - 1, p + j]/j!], {j, 0, n/i}]]]; a[n_] := Ceiling[2^(n - 1)] - b[n, n, 0]; Table[a[n], {n, 0, 40}] (* Jean-François Alcover, Apr 14 2022, after Alois P. Heinz *)