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