OFFSET
0,4
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
FORMULA
a(n) = Sum_{k=0..n} k*binomial(floor((n-1)/2), floor(k/2))*binomial(ceiling((n-1)/2), ceiling(k/2)).
G.f.: g(z)=2*z^2*(1-4*z^2-4*z^3)/((1-2*z)*((1+z)*(1-4*z^2)*(1-2*z)+(1-z-4*z^2)*sqrt(1-4*z^2))).
a(n) ~ 2^(n-1/2)*sqrt(n)/sqrt(Pi). - Vaclav Kotesovec, Mar 21 2014
D-finite with recurrence (n+1)*a(n) + (-n-1)*a(n-1) + 2*(-4*n+5)*a(n-2) + 4*(n+1)*a(n-3) + 16*(n-3)*a(n-4) = 0. - R. J. Mathar, Jun 06 2014
EXAMPLE
a(4)=9 because in UDUD, UDUU, UUDD, UUDU, UUUD, and UUUU we have a total of 3+2+1+2+1+0=9 turns (here U=(1,1) and D=(1,-1)).
MAPLE
g := 2*z^2*(1-4*z^2-4*z^3)/((1-2*z)*((1+z)*(1-4*z^2)*(1-2*z)+(1-z-4*z^2)*sqrt(1-4*z^2))): gser := series(g, z = 0, 35): seq(coeff(gser, z, n), n = 0 .. 32);
a := proc (n) options operator, arrow: sum(k*binomial(floor((1/2)*n-1/2), floor((1/2)*k))*binomial(ceil((1/2)*n-1/2), ceil((1/2)*k)), k = 0 .. n) end proc: seq(a(n), n = 0 .. 32);
MATHEMATICA
CoefficientList[Series[2*x^2*(1-4*x^2-4*x^3)/((1-2*x)*((1+x)*(1-4*x^2)*(1-2*x)+(1-x-4*x^2)*Sqrt[1-4*x^2])), {x, 0, 20}], x] (* Vaclav Kotesovec, Mar 21 2014 *)
PROG
(PARI) x='x+O('x^50); concat([0, 0], Vec(2*x^2*(1-4*x^2-4*x^3)/((1-2*x)*((1+x)*(1-4*x^2)*(1-2*x)+(1-x-4*x^2)*sqrt(1-4*x^2))))) \\ G. C. Greubel, May 27 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
Emeric Deutsch, Jun 06 2011
STATUS
approved