OFFSET
0,5
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..200
FORMULA
a(n) ~ c * (2/Pi)^n * n! * n, where c = 3.08472832460941829086964816782... . - Vaclav Kotesovec, Aug 28 2014
EXAMPLE
a(3) = 1: 123.
a(4) = 9: 1243, 1342, 1432, 2134, 2341, 2431, 3124, 3421, 4123.
a(5) = 59: 12435, 12534, 13245, ..., 53124, 53421, 54123.
a(6) = 358: 124365, 125364, 125463, ..., 653124, 653421, 654123.
MAPLE
b:= proc(u, o, t) option remember;
`if`(t=7, 0, `if`(u+o=0, `if`(t in [4, 5, 6], 1, 0),
add(b(u+j-1, o-j, [2, 5, 2, 5, 7, 5][t]), j=1..o)+
add(b(u-j, o+j-1, [1, 3, 4, 4, 6, 7][t]), j=1..u)))
end:
a:= n-> b(n, 0, 1):
seq(a(n), n=0..25);
MATHEMATICA
b[u_, o_, t_] := b[u, o, t] = If[t==7, 0, If[u+o==0, If[4 <= t <= 6, 1, 0],
Sum[b[u + j - 1, o - j, {2, 5, 2, 5, 7, 5}[[t]]], {j, 1, o}] +
Sum[b[u - j, o + j - 1, {1, 3, 4, 4, 6, 7}[[t]]], {j, 1, u}]]];
a[n_] := b[n, 0, 1];
a /@ Range[0, 25] (* Jean-François Alcover, Jan 03 2021, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Nov 05 2013
STATUS
approved