A124400 a(n) = a(n-1) + 3*a(n-2) - a(n-4), with a(0)=1, a(1)=1, a(2)=4, a(3)=7.
1, 1, 4, 7, 18, 38, 88, 195, 441, 988, 2223, 4992, 11220, 25208, 56645, 127277, 285992, 642615, 1443946, 3244514, 7290360, 16381287, 36808421, 82707768, 185842671, 417584688, 938304280, 2108350576, 4737420745, 10644887785, 23918845740
Offset: 0
Links
- G. C. Greubel, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (1,3,0,-1).
Crossrefs
Cf. A131322.
Programs
-
GAP
a:=[1,1,4,7];; for n in [5..35] do a[n]:=a[n-1]+3*a[n-2]-a[n-4]; od; a; # G. C. Greubel, Dec 25 2019
-
Magma
I:=[1,1,4,7]; [n le 2 select I[n] else Self(n-1) +3*Self(n-2) -Self(n-4): n in [1..35]]; // G. C. Greubel, Dec 25 2019
-
Maple
seq(coeff(series(1/(1-x-3*x^2+x^4), x, n+1), x, n), n = 0..35); # G. C. Greubel, Dec 25 2019
-
Mathematica
LinearRecurrence[{1,3,0,-1}, {1,1,4,7}, 35] (* G. C. Greubel, Dec 25 2019 *) CoefficientList[Series[1/(1-x-3x^2+x^4),{x,0,30}],x] (* Harvey P. Dale, Feb 01 2022 *)
-
PARI
my(x='x+O('x^35)); Vec(1/(1-x-3*x^2+x^4)) \\ G. C. Greubel, Dec 25 2019
-
Sage
def A124400_list(prec): P.
= PowerSeriesRing(ZZ, prec) return P( 1/(1-x-3*x^2+x^4) ).list() A124400_list(35) # G. C. Greubel, Dec 25 2019
Formula
G.f.: 1/(1-x-3*x^2+x^4).
Comments