OFFSET
0
LINKS
Index entries for linear recurrences with constant coefficients, signature (0,1,0,-1).
FORMULA
EXAMPLE
G.f. = x - x^2 - x^4 - x^5 - x^7 + x^8 + x^10 + x^11 + ...
MATHEMATICA
PadRight[{}, 100, {0, 1, -1, 0, -1, -1, 0, -1, 1, 0, 1, 1}] (* Vincenzo Librandi, Dec 31 2016 *)
LinearRecurrence[{0, 1, 0, -1}, {0, 1, -1, 0}, 100] (* Harvey P. Dale, Feb 15 2017 *)
PROG
(Ruby)
def A(m, n)
i, a, b = 0, 0, 1
ary = [0]
while i < n
i += 1
a, b = b, b * m ** i + a
ary << a
end
ary
end
def A280261(n)
A(-1, n)
end
(Magma) &cat [[0, 1, -1, 0, -1, -1, 0, -1, 1, 0, 1, 1]^^10]; // Vincenzo Librandi, Dec 31 2016
CROSSREFS
Cf. similar sequences with the recurrence q^(n-1)*a(n-1) + a(n-2) for n>1, a(0)=0 and a(1)=1: A280222 (q=-3), A280221 (q=-2), this sequence (q=-1), A000045 (q=1), A015473 (q=2), A015474 (q=3), A015475 (q=4), A015476 (q=5), A015477 (q=6), A015479 (q=7), A015480 (q=8), A015481 (q=9), A015482 (q=10), A015484 (q=11).
KEYWORD
sign,easy
AUTHOR
Seiichi Manyama, Dec 30 2016
STATUS
approved