OFFSET
0,5
LINKS
Colin Barker, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (0,-1,-2).
FORMULA
2*((-1)^n)*a(n) + A001607(n+2) = 1 - Creighton Dement, Oct 30 2004
a(n) = -a(n-2) - 2*a(n-3) for n>2. - Colin Barker, May 18 2019
MAPLE
seq(coeff(series((1-x)/((1+x)*(1-x+2*x^2)), x, n+1), x, n), n = 0..40); # G. C. Greubel, Nov 22 2019
MATHEMATICA
LinearRecurrence[{0, -1, -2}, {1, -1, -1}, 40] (* G. C. Greubel, Nov 22 2019 *)
CoefficientList[Series[(1-x)/(1+x^2+2x^3), {x, 0, 60}], x] (* Harvey P. Dale, Mar 31 2023 *)
PROG
(PARI) Vec((1-x)/((1+x)*(1-x+2*x^2)) + O(x^40)) \\ Colin Barker, May 18 2019
(Magma) R<x>:=PowerSeriesRing(Integers(), 40); Coefficients(R!( (1-x)/((1+x)*(1-x+2*x^2)) )); // G. C. Greubel, Nov 22 2019
(Sage)
def A078033_list(prec):
P.<x> = PowerSeriesRing(ZZ, prec)
return P( (1-x)/((1+x)*(1-x+2*x^2)) ).list()
A078033_list(40) # G. C. Greubel, Nov 22 2019
(GAP) a:=[1, -1, -1];; for n in [4..40] do a[n]:=-a[n-2]-2*a[n-3]; od; a; # G. C. Greubel, Nov 22 2019
CROSSREFS
KEYWORD
sign,easy
AUTHOR
N. J. A. Sloane, Nov 17 2002
STATUS
approved