OFFSET
0,3
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (0,2,1,-1).
FORMULA
G.f.: (1 + x)/(1 - 2*x^2 - x^3 + x^4).
MAPLE
seq(coeff(series((1+x)/(1-2*x^2-x^3+x^4), x, n+1), x, n), n = 0..40); # G. C. Greubel, Sep 29 2019
MATHEMATICA
LinearRecurrence[{0, 2, 1, -1}, {1, 1, 2, 3}, 40] (* G. C. Greubel, Sep 29 2019 *)
PROG
(PARI) my(x='x+O('x^40)); Vec((1+x)/(1-2*x^2-x^3+x^4)) \\ G. C. Greubel, Sep 29 2019
(Magma) R<x>:=PowerSeriesRing(Integers(), 40); Coefficients(R!( (1+x)/(1-2*x^2-x^3+x^4) )); // G. C. Greubel, Sep 29 2019
(Sage)
def A027947_list(prec):
P.<x> = PowerSeriesRing(ZZ, prec)
return P((1+x)/(1-2*x^2-x^3+x^4)).list()
A027947_list(40) # G. C. Greubel, Sep 29 2019
(GAP) a:=[1, 1, 2, 3];; for n in [5..40] do a[n]:=2*a[n-2]+a[n-3]-a[n-4]; od; a; # G. C. Greubel, Sep 29 2019
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved