OFFSET
0,7
COMMENTS
This is the second member (k=2) of a k-family of sequences, call them s(k,n) for k = 1, 2, ... and n = 0, 1, ..., with o.g.f. G(k,x) = x^k/((1 + x^k)^2*(1 - x)) = x^k/(1 - x + 2*x^k - 2*x^(k+1) + x^(2*k) - x^(2*k+1)) and the recurrence s(k,n) = s(k,n-1) - 2*s(k,n-k) + 2*s(k,n-k-1) - s(k,n-2*k) + s(k,n-(2*k+1)) with input s(k,n) = 0 if n = 0, 1, ...., k-1, s(k,n) = 1 if n = k, k+1, ..., 2*k-1 and s(k,n) = -1 if n = 2*k. See the Myerson-van der Poorten link, p. 4.
If one prefers the negative integers to precede the positive ones the o.g.f. is -G(k,x).
LINKS
G. Myerson and A. J. van der Poorten, Some problems concerning recurrence sequences, Amer. Math. Monthly 102 (1995), no. 8, 698-705.
Index entries for linear recurrences with constant coefficients, signature (1,-2,2,-1,1)
FORMULA
O.g.f.: x^2/((1 + x^2)^2*(1-x)) = x^2/(1 - x + 2*x^2 - 2*x^3 + x^4 - x^5).
a(n) = a(n-1) - 2*a(n-2) + 2*a(n-3) - a(n-4) + a(n-5), with a(0) = a(1) = 0, a(2) = a(3) = 1 and a(4) = -1. This is the sequence s(2,n) defined in a comment above.
a(n) = floor((n+2)/4)*(-1)^floor((n+2)/2), n >= 0.
MATHEMATICA
LinearRecurrence[{1, -2, 2, -1, 1}, {0, 0, 1, 1, -1}, 90] (* Harvey P. Dale, Sep 03 2020 *)
CROSSREFS
KEYWORD
sign,easy
AUTHOR
Wolfdieter Lang, Jun 17 2014
STATUS
approved