login
Number of dispersed Dyck paths of length n (i.e., Motzkin paths of length n with no (1,0) steps at positive heights) with no initial and no final (1,0)-steps.
4

%I #10 Jul 26 2022 14:58:02

%S 1,0,1,0,2,1,6,5,20,21,70,84,252,330,924,1287,3432,5005,12870,19448,

%T 48620,75582,184756,293930,705432,1144066,2704156,4457400,10400600,

%U 17383860,40116600,67863915,155117520,265182525,601080390,1037158320,2333606220,4059928950,9075135300

%N Number of dispersed Dyck paths of length n (i.e., Motzkin paths of length n with no (1,0) steps at positive heights) with no initial and no final (1,0)-steps.

%F a(2n) = binomial(2n-2,n-1) = A000984(n-1) (n>=1).

%F a(2n+1) = binomial(2n-1,n-2) = A002054(n-1) (n>=1).

%F G.f.: g(z)=1+(1-z)(1-q)/(1-2z+q), where q=sqrt(1-4z^2).

%F a(n) = binomial(n,floor(n/2)) - 2*binomial(n-1,floor((n-1)/2)) + binomial(n-2,floor((n-2)/2)) + 2*0^n. - _Wesley Ivan Hurt_, Sep 27 2014

%F D-finite with recurrence (n+1)*a(n) -n*a(n-1) +2*(-2*n+3)*a(n-2) +4*(n-4)*a(n-3)=0. - _R. J. Mathar_, Jul 26 2022

%e a(6)=6 because we have UDHHUD and the 5 Dyck paths of length 6: UDUDUD, UDUUDD, UUDDUD, UUDUDD, and UUUDDD; here U=(1,1), H=(1,0) and D=(1,-1).

%p a := proc (n) if `mod`(n, 2) = 0 then binomial(n-2, (1/2)*n-1) else binomial(n-2, (1/2)*n-5/2) end if end proc: 1, 0, seq(a(n), n = 2 .. 38);

%p A191529:=n->binomial(n,floor(n/2)) - 2*binomial(n-1,floor((n-1)/2)) + binomial(n-2,floor((n-2)/2)) + 2*0^n: seq(A191529(n), n=0..40); # _Wesley Ivan Hurt_, Sep 27 2014

%t Join[{1}, Table[Binomial[n, Floor[n/2]] - 2 Binomial[n - 1, Floor[(n - 1)/2]] + Binomial[n - 2, Floor[(n - 2)/2]], {n, 40}]] (* _Wesley Ivan Hurt_, Sep 27 2014 *)

%Y Cf. A000984, A002054.

%K nonn,easy

%O 0,5

%A _Emeric Deutsch_, Jun 07 2011