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”).

A280221
a(n) = (-2)^(n-1)*a(n-1) + a(n-2) with a(0) = 0 and a(1) = 1.
6
0, 1, -2, -7, 54, 857, -27370, -1750823, 224077974, 57362210521, -29369227708778, -30074031811578151, 61591587780884344470, 252279113476470463370969, -2066670436007658255050633578, -33860328171270359374279117170983
OFFSET
0,3
LINKS
EXAMPLE
G.f. = x - 2*x^2 - 7*x^3 + 54*x^4 + 857*x^5 - 27370*x^6 + ...
MATHEMATICA
a[n_] := (-2)^(n -1) a[n -1] + a[n -2]; a[0] = 0; a[1] = 1; Array[a, 16, 0] (* Robert G. Wilson v, Dec 29 2016 *)
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 A280221(n)
A(-2, n)
end
(PARI) m=30; v=concat([1, -2], vector(m-2)); for(n=3, m, v[n] = (-2)^(n-1)*v[n-1] + v[n-2]); concat([0], v) \\ G. C. Greubel, Oct 13 2018
(Magma) I:=[1, -2]; [0] cat [n le 2 select I[n] else (-2)^(n-1)*Self(n-1) +Self(n-2): n in [1..30]]; // G. C. Greubel, Oct 13 2018
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), this sequence (q=-2), A280261 (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).
Sequence in context: A371617 A283335 A326207 * A371828 A227381 A182055
KEYWORD
sign
AUTHOR
Seiichi Manyama, Dec 29 2016
STATUS
approved