OFFSET
0,2
COMMENTS
a(2n)/a(2n+1) converges to ((((sqrt 5)-1)/2)^2).
LINKS
Matthew House, Table of n, a(n) for n = 0..4760
Index entries for linear recurrences with constant coefficients, signature (0,3,0,-1).
FORMULA
a(2n-1) = a(2n).
a(n) = 3*a(n-2) - a(n-4).
G.f.: 2x(1+x)/((1-x-x^2)(1+x-x^2)). a(n)=2*A094966(n) = A000045(n+2)-A039834(n-1). - R. J. Mathar, Oct 30 2008
a(n) = -a(-1-n) for all n in Z. - Michael Somos, Nov 01 2016
a(n) = 2*A000045(ceiling(n/2)*2). - Alois P. Heinz, Nov 02 2016
EXAMPLE
a(3) = 2+(-1)+1+0+1+1+2=6.
G.f. = 2*x + 2*x^2 + 6*x^3 + 6*x^4 + 16*x^5 + 16*x^6 + 42*x^7 + ...
MAPLE
a:= n-> 2*(<<0|1>, <1|1>>^(ceil(n/2)*2))[1, 2]:
seq(a(n), n=0..40); # Alois P. Heinz, Nov 02 2016
MATHEMATICA
a[ n_] := 2 Fibonacci[ n + Mod[n, 2]]; (* Michael Somos, Nov 01 2016 *)
LinearRecurrence[{0, 3, 0, -1}, {0, 2, 2, 6}, 50] (* Harvey P. Dale, Aug 07 2022 *)
PROG
(PARI) {a(n) = 2 * fibonacci(n + n%2)}; /* Michael Somos, Nov 01 2016 */
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Carey W. Strutz (cwstrutz(AT)excite.com), Jul 18 2008
EXTENSIONS
a(21)-a(22) corrected by Matthew House, Nov 01 2016
STATUS
approved