|
|
A280261
|
|
Period 12 sequence [0, 1, -1, 0, -1, -1, 0, -1, 1, 0, 1, 1, ...].
|
|
6
|
|
|
0, 1, -1, 0, -1, -1, 0, -1, 1, 0, 1, 1, 0, 1, -1, 0, -1, -1, 0, -1, 1, 0, 1, 1, 0, 1, -1, 0, -1, -1, 0, -1, 1, 0, 1, 1, 0, 1, -1, 0, -1, -1, 0, -1, 1, 0, 1, 1, 0, 1, -1, 0, -1, -1, 0, -1, 1, 0, 1, 1, 0, 1, -1, 0, -1, -1, 0, -1, 1, 0, 1, 1, 0, 1, -1, 0, -1, -1, 0, -1, 1, 0, 1, 1
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0
|
|
LINKS
|
|
|
FORMULA
|
a(n) = (-1)^(n-1)*a(n-1) + a(n-2) with a(0) = 0 and a(1) = 1.
G.f.: x * (1 - x - x^2) / (1 - x^2 + x^4).
|
|
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
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
|
|
|
STATUS
|
approved
|
|
|
|