%I #22 Aug 07 2020 12:07:51
%S 0,3,9,32,139,669,3430,18360,101403,573551,3305445,19340100,114579348,
%T 685962172,4143459504,25220816752,154545611355,952583230899,
%U 5902090839715,36738469359480,229636903762035,1440759023752125,9070230371741490,57278432955350880
%N a(n) is the total number of down steps between the first and second up steps in all 2_1-Dyck paths of length 3*n. A 2_1-Dyck path is a lattice path with steps (1, 2), (1, -1) that starts and ends at y = 0 and stays above the line y = -1.
%C For n = 1, there is no 2nd up step, a(1) = 3 enumerates the total number of down steps between the 1st up step and the end of the path.
%H A. Asinowski, B. Hackl, and S. Selkirk, <a href="https://arxiv.org/abs/2007.15562">Down step statistics in generalized Dyck paths</a>, arXiv:2007.15562 [math.CO], 2020.
%F a(0) = 0 and a(n) = 2*binomial(3*n, n)/(n+1) - binomial(3*n+1, n)/(n+1) + 4*binomial(3*(n-1), n-1)/n - 2*[n=1] for n > 0, where [ ] is the Iverson bracket.
%e For n = 1, the 2_1-Dyck paths are UDD, DUD. This corresponds to a(1) = 2 + 1 = 3 down steps between the 1st up step and the end of the path.
%e For n = 2, the 2_1-Dyck paths are UUDDDD, UDUDDD, UDDUDD, UDDDUD, DUDDUD, DUDUDD, DUUDDD. In total, there are a(2) = 0 + 1 + 2 + 3 + 2 + 1 + 0 = 9 down steps between the 1st and 2nd up step.
%t a[0] = 0; a[n_] := 2 * Binomial[3*n, n]/(n + 1) - Binomial[3*n + 1, n]/(n + 1) + 4 * Binomial[3*(n - 1), n - 1]/n - 2 * Boole[n == 1]; Array[a, 24, 0] (* _Amiram Eldar_, May 09 2020 *)
%o (PARI) a(n) = if (n==0, 0, 2*binomial(3*n, n)/(n+1) - binomial(3*n+1, n)/(n+1) + 4*binomial(3*(n-1), n-1)/n - 2*(n==1)); \\ _Michel Marcus_, May 09 2020
%Y Cf. A007226, A007228, A124724.
%K nonn,easy
%O 0,2
%A _Benjamin Hackl_, May 07 2020