login
a(n) = 2*3^(n-1)-(-1)^n.
1

%I #31 Jun 30 2026 20:31:37

%S 3,5,19,53,163,485,1459,4373,13123,39365,118099,354293,1062883,

%T 3188645,9565939,28697813,86093443,258280325,774840979,2324522933,

%U 6973568803,20920706405,62762119219,188286357653,564859072963

%N a(n) = 2*3^(n-1)-(-1)^n.

%H Vincenzo Librandi, <a href="/A174132/b174132.txt">Table of n, a(n) for n = 1..200</a>

%H <a href="/index/Rec">Index entries for linear recurrences with constant coefficients</a>, signature (2,3).

%F From _Bruno Berselli_, Jan 28 2011 - Jan 30 2011: (Start)

%F G.f.: x*(3-x)/((1+x)*(1-3*x)).

%F a(n) = A062547(A042963(n-1)).

%F a(n) = 2*sum[a(i), i=1..n-1]-2*(-1)^n+1 for n>1. (End)

%t Table[(2 3^(n-1) - (-1)^n), {n, 30}] (* _Vincenzo Librandi_, Aug 21 2014 *)

%t (* Alternative: *)

%t CoefficientList[Series[(3 - x)/((1 + x)(1 - 3 x)), {x, 0, 30}], x] (* _Vincenzo Librandi_, Aug 21 2014 *)

%o (Magma) [2*3^(n-1)-(-1)^n: n in [1..30]]; // _Vincenzo Librandi_, Aug 21 2014

%Y Cf. A154992.

%K nonn,easy

%O 1,1

%A _Vincenzo Librandi_, Jan 27 2011