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

%I #10 Sep 08 2022 08:45:49

%S 1,1,-7,25,-79,241,-727,2185,-6559,19681,-59047,177145,-531439,

%T 1594321,-4782967,14348905,-43046719,129140161,-387420487,1162261465,

%U -3486784399,10460353201,-31381059607,94143178825,-282429536479

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

%C A signed version of A058481 preceded by 1.

%H Vincenzo Librandi, <a href="/A168589/b168589.txt">Table of n, a(n) for n = 0..200</a>

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

%F a(n) = -4*a(n-1) - 3*a(n-2) for n > 1; a(0) = 1, a(1) = 1.

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

%F E.g.f.: 2*exp(-x) - exp(-3*x). - _G. C. Greubel_, Jul 26 2016

%t Table[(2 - 3^n)*(-1)^n, {n,0,50}] (* _G. C. Greubel_, Jul 26 2016 *)

%o (Magma) [ (2-3^n)*(-1)^n: n in [0..25] ];

%o (PARI) a(n)=(2-3^n)*(-1)^n \\ _Charles R Greathouse IV_, Jul 26 2016

%Y Cf. A058481 (3^n-2).

%K sign,easy

%O 0,3

%A _Klaus Brockhaus_, Nov 30 2009