login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A280221 a(n) = (-2)^(n-1)*a(n-1) + a(n-2) with a(0) = 0 and a(1) = 1. 6

%I #34 Sep 08 2022 08:46:18

%S 0,1,-2,-7,54,857,-27370,-1750823,224077974,57362210521,

%T -29369227708778,-30074031811578151,61591587780884344470,

%U 252279113476470463370969,-2066670436007658255050633578,-33860328171270359374279117170983

%N a(n) = (-2)^(n-1)*a(n-1) + a(n-2) with a(0) = 0 and a(1) = 1.

%H Seiichi Manyama, <a href="/A280221/b280221.txt">Table of n, a(n) for n = 0..81</a>

%e G.f. = x - 2*x^2 - 7*x^3 + 54*x^4 + 857*x^5 - 27370*x^6 + ...

%t 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 *)

%o (Ruby)

%o def A(m, n)

%o i, a, b = 0, 0, 1

%o ary = [0]

%o while i < n

%o i += 1

%o a, b = b, b * m ** i + a

%o ary << a

%o end

%o ary

%o end

%o def A280221(n)

%o A(-2, n)

%o end

%o (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

%o (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

%Y 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).

%K sign

%O 0,3

%A _Seiichi Manyama_, Dec 29 2016

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 02:28 EDT 2024. Contains 371917 sequences. (Running on oeis4.)