OFFSET
0,4
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..1000
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 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Jul 15 2020
STATUS
approved