login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A051792
a(n) = (-1)^(n-1)*(a(n-1) - a(n-2)), a(1)=1, a(2)=1.
6
1, 1, 0, 1, 1, 0, -1, 1, 2, -1, -3, 2, 5, -3, -8, 5, 13, -8, -21, 13, 34, -21, -55, 34, 89, -55, -144, 89, 233, -144, -377, 233, 610, -377, -987, 610, 1597, -987, -2584, 1597, 4181, -2584, -6765, 4181, 10946, -6765, -17711, 10946, 28657, -17711, -46368
OFFSET
1,9
FORMULA
a(3-n) = A053602(n).
From Michael Somos: (Start)
G.f.: x*(1 + x + x^2 + 2*x^3)/(1 + x^2 - x^4).
a(n) = -a(n-2) + a(n-4). (End)
a(n) = b(n-1) + b(n-2) + b(n-3) + 2*b(n-4), where b(n) = i^n * A079977(n). - G. C. Greubel, Dec 06 2022
MATHEMATICA
LinearRecurrence[{0, -1, 0, 1}, {1, 1, 0, 1}, 60] (* Harvey P. Dale, May 08 2017 *)
PROG
(PARI) a(n)=fibonacci((3-n)\2+(3-n)%2*2)
(Sage)
def A051792():
x, y, b = 1, 1, true
while True:
yield x
x, y = y, x - y
y = -y if b else y
b = not b
a = A051792()
print([next(a) for _ in range(51)]) # Peter Luschny, Mar 19 2020
(Magma) [Fibonacci(1 -Floor((n-4)/2) -2*((n-4) mod 2)): n in [1..60]]; // G. C. Greubel, Dec 06 2022
CROSSREFS
Sequence in context: A132091 A262090 A239881 * A053602 A272912 A123231
KEYWORD
easy,sign
AUTHOR
Klaus Strassburger (strass(AT)ddfi.uni-duesseldorf.de), Dec 10 1999
STATUS
approved