OFFSET
0,3
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..1000
EXAMPLE
a(6) = 26: 111111, 11112, 11121, 11211, 12111, 21111, 222, 1113, 1131, 1311, 3111, 123, 132, 213, 231, 312, 321, 33, 114, 141, 411, 24, 42, 15, 51, 6.
MAPLE
b:= proc(n, i, p, t) option remember; `if`(n=0 or i=1, `if`(n>0 and
t and n::even, 0, (n+p)!/n!), b(n, i-1, p, t)+add(`if`(t and
j::even, 0, b(n-i*j, i-1, p+j, t or j::even))/j!, j=1..n/i))
end:
a:= n-> b(n$2, 0, false):
seq(a(n), n=0..40);
MATHEMATICA
b[n_, i_, p_, t_] := b[n, i, p, t] = If[n == 0 || i == 1, If[n > 0 &&
t && EvenQ[n], 0, (n + p)!/n!], b[n, i - 1, p, t] + Sum[If[t &&
EvenQ[j], 0, b[n - i*j, i-1, p+j, t || EvenQ[j]]]/j!, {j, 1, n/i}]];
a[n_] := b[n, n, 0, False];
Table[a[n], {n, 0, 40}] (* Jean-François Alcover, Mar 05 2022, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Dec 03 2018
STATUS
approved