%I #17 Mar 27 2021 08:08:06
%S 1,7,121,4411,283073,28318137,4076415425,798519164779,204292676593353,
%T 66150225395814649,26444888796754193841,12792566645739144488693,
%U 7364969554345555373419625,4976538708651698959601499559,3900052284443403730374391636689
%N Number of permutations of {0,1,...,2n+2} with first element n whose sequence of ascents and descents forms a Dyck path.
%C All terms are odd.
%H Alois P. Heinz, <a href="/A316730/b316730.txt">Table of n, a(n) for n = 0..224</a>
%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Lattice_path#Counting_lattice_paths">Counting lattice paths</a>
%F a(n) = A316728(n+1,n).
%F a(n) ~ c * 4^n * (n!)^2, where c = 1.897642067924382577976619913635026612792069869805703855808680498665... - _Vaclav Kotesovec_, Jul 15 2018
%e a(0) = 1: 021.
%e a(1) = 7: 12043, 12430, 13042, 13240, 13420, 14032, 14230.
%e a(2) = 121: 2301654, 2304165, 2304651, 2305164, ..., 2635041, 2635140, 2645031, 2645130.
%p b:= proc(u, o, t) option remember; `if`(u+o=0, 1,
%p `if`(t>0, add(b(u-j, o+j-1, t-1), j=1..u), 0)+
%p `if`(o+u>t, add(b(u+j-1, o-j, t+1), j=1..o), 0))
%p end:
%p a:= n-> b(n, n+2, 0):
%p seq(a(n), n=0..20);
%t b[u_, o_, t_] := b[u, o, t] = If[u + o == 0, 1,
%t If[t > 0, Sum[b[u - j, o + j - 1, t - 1], {j, 1, u}], 0] +
%t If[o + u > t, Sum[b[u + j - 1, o - j, t + 1], {j, 1, o}], 0]];
%t a[n_] := b[n, n+2, 0];
%t a /@ Range[0, 20] (* _Jean-François Alcover_, Mar 27 2021, after _Alois P. Heinz_ *)
%Y Cf. A316728.
%K nonn
%O 0,2
%A _Alois P. Heinz_, Jul 11 2018
|