OFFSET
0,5
LINKS
Vaclav Kotesovec, Table of n, a(n) for n = 0..900 (terms 0..650 from Alois P. Heinz)
EXAMPLE
a(2) = 1: 11.
a(4) = 3: 22, 112, 211.
a(5) = 4: 113, 122, 221, 311.
a(6) = 5: 33, 114, 411, 1122, 2211.
a(7) = 12: 115, 133, 223, 322, 331, 511, 1123, 1132, 2113, 2311, 3112, 3211.
a(8) = 21: 44, 116, 224, 233, 332, 422, 611, 1124, 1133, 1142, 1223, 1322, 2114, 2213, 2231, 2411, 3122, 3221, 3311, 4112, 4211.
MAPLE
g:= proc(n, k) option remember; `if`(k<0 or n<0, 0,
`if`(k=0, `if`(n=0, 1, 0), g(n-k, k)+k*g(n-k, k-1)))
end:
b:= proc(n, i) option remember; expand(`if`(i*(i+1)<n, 0,
`if`(n=0, 1, `if`(i<1, 0, add(b(n-i*j, i-1)*
`if`(j=0, 1, x) , j=0..2)))))
end:
a:= n-> (p-> add(coeff(p, x, i)*i!, i=0..degree(p)))(b(n$2))
-add(g(n, k), k=0..floor((sqrt(8*n+1)-1)/2)):
seq(a(n), n=0..50);
MATHEMATICA
g[n_, k_] := g[n, k] = If[k < 0 || n < 0, 0, If[k == 0, If[n == 0, 1, 0], g[n - k, k] + k*g[n - k, k - 1]]];
b[n_, i_] := b[n, i] = Expand[If[i(i+1) < n, 0, If[n == 0, 1, If[i < 1, 0, Sum[b[n - i*j, i - 1]*If[j == 0, 1, x], {j, 0, 2}]]]]];
a[n_] := With[{p = b[n, n]}, Sum[Coefficient[p, x, i]*i!, {i, 0, Exponent[p, x]}]] - Sum[g[n, k], {k, 0, Floor[(Sqrt[8n + 1] - 1)/2]}];
a /@ Range[0, 50] (* Jean-François Alcover, Dec 29 2020, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Sep 14 2015
STATUS
approved