OFFSET
0,3
COMMENTS
LINKS
FORMULA
G.f.: (1 - 2*x + 2*x^2)/((1 + x)*(1 - x)^2).
a(n) = (2*n - 1)/4 + 5*(-1)^n/4.
a(n) = floor((n+2)/2) - 2 * (n mod 2). - Reinhard Zumkeller, Apr 06 2015
a(n) = a(n-1) + a(n-2) - a(n-3) for n > 2. - Wesley Ivan Hurt, Jan 10 2017
E.g.f.: ((2 + x)*cosh(x) - (3 - x)*sinh(x))/2. - Stefano Spezia, Jul 01 2023
MAPLE
MATHEMATICA
Table[(2n - 1)/4 + 5(-1)^n/4, {n, 0, 75}] (* Or *) Flatten[ Table[{n + 1, n - 1}, {n, 0, 37}]] (* Or *) CoefficientList[Series[(1 - 2x + 2x^2)/((1 + x)(1 - x)^2), {x, 0, 75}], x] (* Robert G. Wilson v, Jul 24 2004 *)
PROG
(Haskell)
import Data.List (transpose)
a097065 n = n' - 2 * m where (n', m) = divMod (n + 2) 2
a097065_list = concat $ transpose [[1 ..], [-1 ..]]
(PARI) a(n)=n\2+1-n%2*2 \\ Charles R Greathouse IV, Sep 02 2015
(Magma) [(2*n-1)/4 + 5*(-1)^n/4 : n in [0..100]]; // Wesley Ivan Hurt, Jan 10 2017
CROSSREFS
KEYWORD
easy,sign
AUTHOR
Paul Barry, Jul 22 2004
STATUS
approved