OFFSET
1,3
COMMENTS
Column 0 of A121484.
LINKS
Colin Barker, Table of n, a(n) for n = 1..1000
E. Barcucci, A. Del Lungo, S. Fezzi and R. Pinzani, Nondecreasing Dyck paths and q-Fibonacci numbers, Discrete Math., 170, 1997, 211-217.
Index entries for linear recurrences with constant coefficients, signature (1,4,-2,-4,0,1).
FORMULA
G.f.: z(1-z^2)(1-2z^2)/(1-z-4z^2+2z^3+4z^4-z^6).
a(n) = a(n-1)+4*a(n-2)-2*a(n-3)-4*a(n-4)+a(n-6) for n>6. - Colin Barker, Sep 11 2015
EXAMPLE
a(4)=4 because we have UDUDUDUD, UDUUUDDD, UUUDDDUD and UUUDUDDD, where U=(1,1) and D=(1,-1).
MAPLE
G:=z*(1-z^2)*(1-2*z^2)/(1-4*z^2-z+4*z^4-z^6+2*z^3): Gser:=series(G, z=0, 40): seq(coeff(Gser, z, n), n=1..37);
MATHEMATICA
LinearRecurrence[{1, 4, -2, -4, 0, 1}, {1, 1, 2, 4, 8, 16}, 40] (* Vincenzo Librandi, Sep 12 2015 *)
PROG
(PARI) Vec(z*(1-z^2)*(1-2*z^2)/(1-z-4*z^2+2*z^3+4*z^4-z^6) + O(z^60)) \\ Michel Marcus, Sep 11 2015
(Magma) I:=[1, 1, 2, 4, 8, 16]; [n le 6 select I[n] else Self(n-1)+4*Self(n-2)-2*Self(n-3)-4*Self(n-4)+Self(n-6): n in [1..40]]; // Vincenzo Librandi, Sep 12 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Emeric Deutsch, Aug 02 2006
STATUS
approved