OFFSET
0,3
COMMENTS
Alternating sum of A080039.
LINKS
Robert Israel, Table of n, a(n) for n = 0..2610
Eric Weisstein's World of Mathematics, Silver Ratio
Index entries for linear recurrences with constant coefficients, signature (-1,4,0,-3,1).
FORMULA
O.g.f.: (1 - x^2 - 2*x^3)/((1 - x)^2*(1 + x)*(1 + 2*x - x^2)).
E.g.f.: ((-4*sqrt(2)*sinh(sqrt(2)*x) - 1)*exp(-x) + (5 - 2*x)*exp(x))/4.
a(n) = -a(n-1) + 4*a(n-2) - 3*a(n-4) + a(n-5).
a(n) = (2*sqrt(2)*(-1 - sqrt(2))^n - 2*sqrt(2)*(sqrt(2) - 1)^n - (-1)^n - 2*n + 5)/4.
a(n) ~ (-1)^n*s^(n+1)/(s + 1), where s is the silver ratio (A014176).
MAPLE
f:= gfun:-rectoproc({a(n) = -a(n-1) + 4*a(n-2) - 3*a(n-4) + a(n-5), seq(a(i)=[ 1, -1, 4, -10, 23][i+1], i=0..4)}, a(n), remember):
map(f, [$0..40]); # Robert Israel, Oct 31 2016
MATHEMATICA
Accumulate[Table[(-1)^n Floor[(1 + Sqrt[2])^n], {n, 0, 32}]]
LinearRecurrence[{-1, 4, 0, -3, 1}, {1, -1, 4, -10, 23}, 33]
PROG
(Magma) I:=[1, -1, 4, -10, 23]; [n le 5 select I[n] else -Self(n-1)+4*Self(n-2)-3*Self(n-4)+Self(n-5): n in [1..35]]; // Vincenzo Librandi, Nov 01 2016
(PARI) x='x+O('x^30); Vec((1-x^2-2*x^3)/((1-x)^2*(1+x)*(1+2*x-x^2))) \\ G. C. Greubel, Sep 30 2018
CROSSREFS
KEYWORD
easy,sign
AUTHOR
Ilya Gutkovskiy, Oct 31 2016
STATUS
approved