OFFSET
0,3
LINKS
Colin Barker, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (-1,1,1).
FORMULA
a(n) = (1/4) * ((1-6*n) * (-1)^n - 1).
G.f.: (x-2*x^2)/((1+x)*(1-x^2)).
a(n) = 2*a(n-2) - a(n-4) = -(-1)^n * A032766(n) = A001057(n) - 2*A001057(n-1). - Ralf Stephan, Aug 18 2013
a(n) = (2n - 1 - floor((n-1)/2)) * (-1)^(n-1). - Wesley Ivan Hurt, Nov 10 2013
MAPLE
MATHEMATICA
Table[((1 - 6n)(-1)^n - 1)/4, {n, 0, 100}] (* Wesley Ivan Hurt, Nov 10 2013 *)
LinearRecurrence[{-1, 1, 1}, {0, 1, -3}, 101] (* T. D. Noe, Nov 11 2013 *)
PROG
(Magma) [((1-6*n)*(-1)^n-1)/4 : n in [0..100]]; // Zaki Khandaker, Jun 21 2015
(PARI) concat(0, Vec(x*(2*x-1)/((x-1)*(x+1)^2) + O(x^100))) \\ Colin Barker, Jun 21 2015
CROSSREFS
KEYWORD
easy,sign
AUTHOR
Paul Barry, May 09 2003
EXTENSIONS
Definition fixed by Ralf Stephan, Aug 18 2013
STATUS
approved