OFFSET
0,4
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..33
FORMULA
a(n) = A238341(n^2,n).
EXAMPLE
a(3) = 21: 333, 111222, 112122, 112212, 112221, 121122, 121212, 121221, 122112, 122121, 122211, 211122, 211212, 211221, 212112, 212121, 212211, 221112, 221121, 221211, 222111.
MAPLE
b:= proc(n, p, i) option remember; `if`(n=0, p!,
`if`(i<1, 0, add(b(n-i*j, p+j, i-1)/j!, j=0..n/i)))
end:
a:= n-> add(b(n^2-i*n, n, i-1)/n!, i=0..n):
seq(a(n), n=0..15);
MATHEMATICA
b[n_, p_, i_] := b[n, p, i] = If[n == 0, p!,
If[i < 1, 0, Sum[b[n - i*j, p + j, i - 1]/j!, {j, 0, n/i}]]];
a[n_] := Sum[b[n^2 - i*n, n, i - 1]/n!, {i, 0, n}];
Table[a[n], {n, 0, 15}] (* Jean-François Alcover, Mar 04 2022, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Jun 09 2014
STATUS
approved