OFFSET
1,4
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..5000
EXAMPLE
a(4) = 3:
4 -> 31 -> 211 (3 parts)
MAPLE
b:= proc(n, i, k) option remember; `if`(n=0, [1, 0],
`if`(k=0, [1, 1], `if`(i*(i+1)/2<n, 0, b(n, i-1, k)+
(h-> (f-> f +[0, f[1]*h[2]/h[1]])(h[1]*
b(n-i, min(n-i, i-1), k)))(b(i$2, k-1)))))
end:
a:= n-> (k-> add(b(n$2, i)[2]*(-1)^(k-i)*binomial(k, i), i=0..k))(2):
seq(a(n), n=1..41);
MATHEMATICA
b[n_, i_, k_] := b[n, i, k] = With[{}, If[n == 0, {1, 0}, If[k == 0, {1, 1}, If[i (i + 1)/2 < n, {0, 0}, b[n, i - 1, k] + Function[h, Function[f, f + {0, f[[1]] h[[2]]/h[[1]]}][h[[1]] b[n - i, Min[n - i, i - 1], k]]][ b[i, i, k - 1]]]]]];
T[n_, k_] := Sum[b[n, n, i][[2]] (-1)^(k - i) Binomial[k, i], {i, 0, k}];
a[n_] := T[n, 2];
Array[a, 41] (* Jean-François Alcover, Dec 09 2020, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Sep 25 2019
STATUS
approved