OFFSET
1,1
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..200
Index entries for linear recurrences with constant coefficients, signature (2,3).
FORMULA
From Bruno Berselli, Jan 28 2011 - Jan 30 2011: (Start)
G.f.: x*(3-x)/((1+x)*(1-3*x)).
a(n) = 2*sum[a(i), i=1..n-1]-2*(-1)^n+1 for n>1. (End)
MATHEMATICA
Table[(2 3^(n-1) - (-1)^n), {n, 30}] (* Vincenzo Librandi, Aug 21 2014 *)
(* Alternative: *)
CoefficientList[Series[(3 - x)/((1 + x)(1 - 3 x)), {x, 0, 30}], x] (* Vincenzo Librandi, Aug 21 2014 *)
PROG
(Magma) [2*3^(n-1)-(-1)^n: n in [1..30]]; // Vincenzo Librandi, Aug 21 2014
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Vincenzo Librandi, Jan 27 2011
STATUS
approved
