A026551 Expansion of 3*(1+2*x-2*x^2)/((1-x)*(1-6*x^2)).
3, 9, 21, 57, 129, 345, 777, 2073, 4665, 12441, 27993, 74649, 167961, 447897, 1007769, 2687385, 6046617, 16124313, 36279705, 96745881, 217678233, 580475289, 1306069401, 3482851737, 7836416409, 20897110425, 47018498457
Offset: 0
Links
- G. C. Greubel, Table of n, a(n) for n = 0..1000
- Kival Ngaokrajang, Illustration of initial terms
- Index entries for linear recurrences with constant coefficients, signature (1, 6, -6).
Programs
-
Magma
[(3/5)*(-1 + 6^(1+Floor(n/2))*((n+1) mod 2) + 16*6^(Floor((n-1)/2))*(n mod 2)): n in [0..40]]; // G. C. Greubel, Apr 12 2022
-
Mathematica
Table[(3/5)*(-1 +3*6^(n/2)*(1+(-1)^n) +8*6^((n-1)/2)*(1-(-1)^n)), {n, 0, 40}] (* G. C. Greubel, Apr 12 2022 *)
-
PARI
Vec( 3*(1+2*x-2*x^2)/((1-x)*(1-6*x^2))+O(x^33)); \\ Joerg Arndt, Dec 20 2014
-
SageMath
[(3/5)*(-1 + 6*6^(n/2)*((n+1)%2) + 16*6^((n-1)/2)*(n%2)) for n in (0..40)] # G. C. Greubel, Apr 12 2022
Formula
G.f.: 3*(1+2*x-2*x^2)/((1-x)*(1-6*x^2)). - Ralf Stephan, Feb 03 2004
From G. C. Greubel, Apr 12 2022: (Start)
a(n) = (3/5)*( -1 + 3*6^(n/2)*(1 + (-1)^n) + 8*6^((n-1)/2)*(1 - (-1)^n) ).
a(2*n) = (3/5)*(6^(n+1) - 1).
a(2*n+1) = (3/5)*(16*6^n -1).
a(n) = a(n-1) + 6*a(n-2) - a(n-3). (End)
Extensions
Name corrected by G. C. Greubel, Apr 12 2022
Comments