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!)
A181716 a(n) = a(n-1) + a(n-2) + (-1)^n, with a(0)=0 and a(1)=1. 3
0, 1, 2, 2, 5, 6, 12, 17, 30, 46, 77, 122, 200, 321, 522, 842, 1365, 2206, 3572, 5777, 9350, 15126, 24477, 39602, 64080, 103681, 167762, 271442, 439205, 710646, 1149852, 1860497, 3010350, 4870846, 7881197, 12752042, 20633240, 33385281 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,3

COMMENTS

Aside from the first term, duplicate of A098600.

LINKS

Vincenzo Librandi, Table of n, a(n) for n = 0..1000

Index entries for linear recurrences with constant coefficients, signature (0,2,1).

FORMULA

a(n) = a(n-1) + a(n-2) + (-1)^n = 2a(n-2) + a(n-3).

a(n) - A000045(n) = A008346(n-2).

G.f.: x*(1+2*x)/(1-2*x^2-x^3). [Colin Barker, Jan 09 2012]

MATHEMATICA

a[0] = 0; a[1] = 1; a[n_] := a[n] = a[n - 1] + a[n - 2] + (-1)^n; Array[a, 38, 0]

LinearRecurrence[{0, 2, 1}, {0, 1, 2}, 40] (* Vincenzo Librandi, Jan 09 2012 *)

PROG

(Magma) I:=[0, 1, 2]; [n le 3 select I[n] else 2*Self(n-2)+Self(n-3): n in [1..40]]; // Vincenzo Librandi, Jan 09 2012

CROSSREFS

Cf. A119282.

Sequence in context: A238517 A335240 A099926 * A355021 A098600 A261866

Adjacent sequences:  A181713 A181714 A181715 * A181717 A181718 A181719

KEYWORD

easy,nonn

AUTHOR

Robert G. Wilson v, Nov 07 2010

STATUS

approved

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 September 27 03:56 EDT 2022. Contains 357052 sequences. (Running on oeis4.)