login
A052929
Expansion of (2-3*x-x^2)/((1-x^2)*(1-3*x)).
2
2, 3, 10, 27, 82, 243, 730, 2187, 6562, 19683, 59050, 177147, 531442, 1594323, 4782970, 14348907, 43046722, 129140163, 387420490, 1162261467, 3486784402, 10460353203, 31381059610, 94143178827, 282429536482, 847288609443, 2541865828330, 7625597484987
OFFSET
0,1
FORMULA
G.f.: (2-3*x-x^2)/((1-x^2)*(1-3*x)).
a(n) = 3*a(n-1) + a(n-2) - 3*a(n-3), a(0)=2, a(1)=3, a(2)=10.
a(n) = 3^n + Sum_{alpha=RootOf(-1+z^2)} alpha^(-n)/2.
a(n) = 2*A033113(n+1) - 3*A033113(n) - A033113(n-1). - R. J. Mathar, Nov 28 2011
From Bruno Berselli, Aug 27 2013: (Start)
a(n) = 3^n + (1+(-1)^n)/2.
a(n) = Sum_{k=0..n} (-1)^k + 2^k*binomial(n,k). (End)
MAPLE
spec:= [S, {S=Union(Sequence(Prod(Z, Z)), Sequence(Union(Z, Z, Z)))}, unlabeled]: seq(combstruct[count](spec, size=n), n=0..20);
seq(3^n + (1+(-1)^n)/2, n=0..30); # G. C. Greubel, Oct 17 2019
MATHEMATICA
Table[3^n + (1+(-1)^n)/2, {n, 0, 30}] (* Bruno Berselli, Aug 27 2013 *)
LinearRecurrence[{3, 1, -3}, {2, 3, 10}, 40] (* Vincenzo Librandi, Mar 09 2018 *)
Table[3^n + Fibonacci[n+1, 0], {n, 0, 30}] (* G. C. Greubel, Oct 17 2019 *)
PROG
(Magma) [&+[(-1)^k+2^k*Binomial(n, k): k in [0..n]]: n in [0..30]]; // Bruno Berselli, Aug 27 2013
(PARI) x='x+O('x^30); Vec((2-3*x-x^2)/((1-x^2)*(1-3*x))) \\ Altug Alkan, Mar 09 2018
(Sage) [3^n + (1+(-1)^n)/2 for n in (0..30)] # G. C. Greubel, Oct 17 2019
(GAP) List([0..30], n-> 3^n + (1+(-1)^n)/2 ); # G. C. Greubel, Oct 17 2019
CROSSREFS
Cf. A052531: 2^n + (1+(-1)^n)/2.
Sequence in context: A303836 A238937 A278088 * A151415 A134588 A000060
KEYWORD
nonn,easy
AUTHOR
encyclopedia(AT)pommard.inria.fr, Jan 25 2000
EXTENSIONS
More terms from James A. Sellers, Jun 05 2000
STATUS
approved