OFFSET
1,2
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..1000
MAPLE
b:= proc(n, i) option remember; `if`(n=0, [1],
`if`(n>i*(i+1)/2, [], zip((x, y)->x+y, b(n, i-1),
`if`(i>n, [], [0, b(n-i, i-1)[]]), 0)))
end:
a:= proc(n) local l; l:= b(n$2);
add(l[i+1]*i!*binomial(n, i), i=1..nops(l)-1)
end:
seq (a(n), n=1..40); # Alois P. Heinz, Nov 20 2012
MATHEMATICA
zip[f_, x_List, y_List, z_] := With[{m = Max[Length[x], Length[y]]}, Thread[f[PadRight[x, m, z], PadRight[y, m, z]]]]; b[n_, i_] := b[n, i] = If[n == 0, {1}, If[n > i*(i+1)/2, {}, zip[Plus, b[n, i-1], If[i>n, {}, Join[{0}, b[n-i, i-1]]], 0]]]; a[n_] := Module[{l}, l = b[n, n]; Sum[l[[i+1]]*i!*Binomial[n, i], {i, 1, Length[l]-1}]]; Table[a[n], {n, 1, 40}] (* Jean-François Alcover, Jan 29 2014, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Vladeta Jovovic, Sep 21 2004
STATUS
approved