OFFSET
0,3
COMMENTS
a(0) = 1 by convention.
Also number of ballot sequences of length n where the last position has a maximal value.
Main diagonal of A238727.
LINKS
Joerg Arndt and Alois P. Heinz, Table of n, a(n) for n = 0..60
Wikipedia, Young tableau
EXAMPLE
a(4) = 7 counts the following tableaux:
[1] [1 2] [1 3] [1 2 3] [1 2] [1 3] [1 2 3 4]
[2] [3] [2] [4] [3 4] [2 4]
[3] [4] [4]
[4]
corresponding to the following ballot sequences: [1,2,3,4], [1,1,2,3], [1,2,1,3], [1,1,1,2], [1,1,2,2], [1,2,1,2], [1,1,1,1].
MAPLE
h:= proc(l) local n; n:=nops(l); add(i, i=l)!/mul(mul(1+l[i]-j+
add(`if`(l[k]>=j, 1, 0), k=i+1..n), j=1..l[i]), i=1..n) end:
g:= l->`if`(l=[], 1, h(subsop(-1=`if`(l[-1]=1, [][], l[-1]-1), l))):
b:= proc(n, i, l) `if`(n=0 or i=1, g([l[], 1$n]),
add(b(n-i*j, i-1, [l[], i$j]), j=0..n/i)) end:
a:= n-> b(n, n, []):
seq(a(n), n=0..28);
MATHEMATICA
h[l_List] := With[{n=Length[l]}, Total[l]!/Product[Product[1+l[[i]]-j+Sum[If[l[[k]] >= j, 1, 0], {k, i+1, n}], {j, 1, l[[i]]}], {i, 1, n}]]; g[l_List] := If[l == {}, 1, h[If[Last[l] == 1, Most[l], Append[Most[l], Last[l]-1]]]]; b[n_, i_, l_List] := If[n == 0 || i == 1, g[Join[l, Array[1&, n]]], Sum[b[n-i*j, i-1, Join[l, Array[i&, j]]], {j, 0, n/i}]]; a[n_] := b[n, n, {}]; Table[a[n], {n, 0, 28}] (* Jean-François Alcover, Feb 12 2015, after Maple *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Joerg Arndt and Alois P. Heinz, Mar 03 2014
STATUS
approved