A153772 a(n) = (2^n + 2*(-1)^n - 6)/3.
-1, -2, 0, 0, 4, 8, 20, 40, 84, 168, 340, 680, 1364, 2728, 5460, 10920, 21844, 43688, 87380, 174760, 349524, 699048, 1398100, 2796200, 5592404, 11184808, 22369620, 44739240, 89478484, 178956968, 357913940, 715827880
Offset: 0
Links
- Vincenzo Librandi, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (2,1,-2).
Programs
-
Magma
[2^n/3 +2*(-1)^n/3-2: n in [0..40]]; // Vincenzo Librandi, Aug 07 2011
-
Mathematica
Table[(2^n + 2*(-1)^n - 6)/3, {n,0,25}] (* or *) LinearRecurrence[{2, 1, -2}, {-1, -2, 0}, 25] (* G. C. Greubel, Aug 27 2016 *)
-
PARI
a(n)=(2^n+2*(-1)^n-6)/3 \\ Charles R Greathouse IV, Aug 28 2016
Formula
a(n) = A078008(n) - 2.
a(n) = +2*a(n-1) +a(n-2) -2*a(n-3).
a(n) = a(n-1) + 2*a(n-2) + 4.
G.f.: (1 - 5*x^2) / ( (1-x)*(2*x-1)*(1+x) ).
E.g.f.: (1/3)*(2*exp(-x) - 6*exp(x) + exp(2*x)). - G. C. Greubel, Aug 27 2016
a(n) = 4*A000975(n-3) for n >= 3. - Markus Sigg, Sep 14 2020
Comments