OFFSET
0,2
COMMENTS
a(n+1)/3 = A001792(n).
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (4,-4).
FORMULA
G.f.: (x^2 - x + 1)/(1-2*x)^2.
a(n) = 3*(0^n/3 + 2^n + n*2^n)/4.
For n > 1: a(n) = 2*a(n-1) + 3*2^(n-2). - Philippe Deléham, Nov 10 2011
a(n) = 4*a(n-1) - 4*a(n-2). - Vincenzo Librandi, Jun 24 2012
MATHEMATICA
CoefficientList[Series[(x^2-x+1)/(1-2x)^2, {x, 0, 40}], x] (* Vincenzo Librandi, Jun 24 2012 *)
PROG
(PARI) a(n)=3*(0^n/3+2^n+n<<n)/4 \\ Charles R Greathouse IV, Nov 11 2011
(Magma) I:=[1, 3, 9]; [n le 3 select I[n] else 4*Self(n-1)-4*Self(n-2): n in [1..50]]; // Vincenzo Librandi, Jun 24 2012
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Paul Barry, Jun 11 2003
STATUS
approved