OFFSET
0,2
LINKS
Index entries for linear recurrences with constant coefficients, signature (1,3,-2,-2).
FORMULA
a(n) = a(n-1) + 3a(n-2) - 2a(n-3) - 2a(n-4); g.f. (1+x-x^2) / (1-x-x^2)(1-2x^2).
a(n) = 2*A000045(n+3) - 2^floor((n+2)/2) - 2^floor((n+1)/2). - Max Alekseyev, Jun 02 2005
MATHEMATICA
LinearRecurrence[{1, 3, -2, -2}, {1, 2, 4, 8}, 40] (* Harvey P. Dale, Feb 01 2012 *)
PROG
(PARI) a(n) = 2*fibonacci(n+3) - 2^((n+2)\2) - 2^((n+1)\2) /* Max Alekseyev */
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved