A094388 Expansion of (1- 2*x - x^2)/((1-x)*(1-3*x)).
1, 2, 4, 10, 28, 82, 244, 730, 2188, 6562, 19684, 59050, 177148, 531442, 1594324, 4782970, 14348908, 43046722, 129140164, 387420490, 1162261468, 3486784402, 10460353204, 31381059610, 94143178828, 282429536482, 847288609444
Offset: 0
Links
- Vincenzo Librandi, Table of n, a(n) for n = 0..600
- Index entries for linear recurrences with constant coefficients, signature (4,-3).
Programs
-
Magma
[3^n/3-0^n/3+1: n in [0..30]]; // Vincenzo Librandi, May 21 2011
-
Mathematica
CoefficientList[Series[(1-2x-x^2)/((1-x)(1-3x)),{x,0,30}],x] (* Harvey P. Dale, May 20 2011 *)
-
PARI
a(n)=3^n/3-0^n/3+1 \\ Charles R Greathouse IV, Nov 27 2012
-
SageMath
[(3^n +3 -int(n==0))//3 for n in range(41)] # G. C. Greubel, Sep 27 2024
Formula
a(n) = 3^n/3 - 0^n/3 + 1.
a(n+1) = 2*A007051(n).
a(n) = A034472(n-1), n > 0. - R. J. Mathar, Sep 05 2008
G.f.: G(0), where G(k)= 1 + 3^k*x/(1 - x/(x + 3^k*x/G(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Jul 26 2013
E.g.f.: (1/3)*(-1 + 3*exp(x) + exp(3*x)). - G. C. Greubel, Sep 27 2024
Comments