login
A140413
a(2n) = A000045(6n) + 1, a(2n+1) = A000045(6n+3) - 1.
5
1, 1, 9, 33, 145, 609, 2585, 10945, 46369, 196417, 832041, 3524577, 14930353, 63245985, 267914297, 1134903169, 4807526977, 20365011073, 86267571273, 365435296161, 1548008755921, 6557470319841, 27777890035289, 117669030460993, 498454011879265, 2111485077978049
OFFSET
0,3
FORMULA
a(n) = A141325(3*n) = (-1)^n + A014445(n).
a(n) = +3*a(n-1) +5*a(n-2) +a(n-3). - R. J. Mathar, Dec 17 2010
G.f.: (1-x)^2 / ( (1+x)*(1-4*x-x^2) ). - R. J. Mathar, Dec 17 2010
a(n) = ((-1)^n + (-(2-sqrt(5))^n + (2+sqrt(5))^n) / sqrt(5)). - Colin Barker, Jun 06 2017
a(n) = -A033887(n) + 2*Sum_{k=0..n} A033887(k)*(-1)^(n-k). - Yomna Bakr and Greg Dresden, Jun 03 2024
MATHEMATICA
LinearRecurrence[{3, 5, 1}, {1, 1, 9}, 30] (* or *) CoefficientList[Series[ (1-x)^2/((1+x)(1-4*x-x^2)), {x, 0, 30}], x] (* Harvey P. Dale, Jun 20 2011 *)
PROG
(PARI) Vec((1-x)^2/((1+x)*(1-4*x-x^2)) + O(x^30)) \\ Colin Barker, Jun 06 2017
(Magma) R<x>:=PowerSeriesRing(Integers(), 30); Coefficients(R!( (1-x)^2/((1+x)*(1-4*x-x^2)) )); // G. C. Greubel, Jun 08 2019
(Sage) ((1-x)^2/((1+x)*(1-4*x-x^2))).series(x, 30).coefficients(x, sparse=False) # G. C. Greubel, Jun 08 2019
(GAP) a:=[1, 1, 9];; for n in [4..30] do a[n]:=3*a[n-1]+5*a[n-2]+a[n-3]; od; a; # G. C. Greubel, Jun 08 2019
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Paul Curtz, Jun 17 2008
STATUS
approved