A140413 a(2n) = A000045(6n) + 1, a(2n+1) = A000045(6n+3) - 1.
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
Links
- Colin Barker, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (3,5,1).
Programs
-
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
-
Magma
R
:=PowerSeriesRing(Integers(), 30); Coefficients(R!( (1-x)^2/((1+x)*(1-4*x-x^2)) )); // G. C. Greubel, Jun 08 2019 -
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 *)
-
PARI
Vec((1-x)^2/((1+x)*(1-4*x-x^2)) + O(x^30)) \\ Colin Barker, Jun 06 2017
-
Sage
((1-x)^2/((1+x)*(1-4*x-x^2))).series(x, 30).coefficients(x, sparse=False) # G. C. Greubel, Jun 08 2019
Formula
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