OFFSET
0,2
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (0,3,0,-2).
FORMULA
a(2n) = 5*2^n - 4; a(2n+1) = 5*2^n - 2 (n >= 0). - Emeric Deutsch, Oct 10 2006
From Colin Barker, Sep 10 2012: (Start)
a(n) = 3*a(n-2) - 2*a(n-4).
G.f.: (1+3*x+3*x^2-x^3)/((1-x)*(1+x)*(1-2*x^2)). (End)
E.g.f.: 5*cosh(sqrt(2)*x) - 4*cosh(x) + 5*sinh(sqrt(2)*x)/sqrt(2) - 2*sinh(x). - Stefano Spezia, Oct 03 2023
EXAMPLE
1, 1+2=3, 3*2=6, 6+2=8, 8*2=16, ...
MAPLE
a:=proc(n) if n mod 2 = 0 then 5*2^(n/2)-4 else 5*2^((n-1)/2)-2 fi end: seq(a(n), n=0..45); # Emeric Deutsch, Oct 10 2006
MATHEMATICA
nxt[{a_, b_}]:={b+2, 2(b+2)}; Rest[Flatten[NestList[nxt, {1, 1}, 20]]] (* or *) LinearRecurrence[{0, 3, 0, -2}, {1, 3, 6, 8}, 40] (* Harvey P. Dale, Oct 10 2012 *)
CoefficientList[Series[(1 + 3 x + 3 x^2 - x^3) / ((1 - x) (1 + x) (1 - 2 x^2)), {x, 0, 40}], x] (* Vincenzo Librandi, Jun 25 2013 *)
PROG
(Magma) m:=50; R<x>:=PowerSeriesRing(Integers(), m); Coefficients(R!((1+3*x+3*x^2-x^3)/((1-x^2)*(1-2*x^2)))); // Vincenzo Librandi, Jun 25 2013
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Philippe Deléham, Oct 04 2006
EXTENSIONS
More terms from Emeric Deutsch, Oct 10 2006
STATUS
approved