login
This site is supported by donations to The OEIS Foundation.

 

Logo

Annual appeal: Please make a donation to keep the OEIS running! Over 6000 articles have referenced us, often saying "we discovered this result with the help of the OEIS".
Other ways to donate

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A168195 a(n) = 2*n - a(n-1) + 1 with n>1, a(1)=5. 1
5, 0, 7, 2, 9, 4, 11, 6, 13, 8, 15, 10, 17, 12, 19, 14, 21, 16, 23, 18, 25, 20, 27, 22, 29, 24, 31, 26, 33, 28, 35, 30, 37, 32, 39, 34, 41, 36, 43, 38, 45, 40, 47, 42, 49, 44, 51, 46, 53, 48, 55, 50, 57, 52, 59, 54, 61, 56, 63, 58, 65, 60, 67, 62, 69, 64, 71, 66, 73 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

LINKS

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

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

FORMULA

a(n) = a(n-1) + a(n-2) - a(n-3) = n + 1 - 3*(-1)^n. - R. J. Mathar, Nov 22 2009

G.f.: x*(5+2*x^2-5*x)/((1+x)*(x-1)^2). - R. J. Mathar, Nov 22 2009

a(n) = n - 4 + 2^(2-(-1)^n). - Wesley Ivan Hurt, Dec 13 2013

a(n) = A004442(n-1) + 2*(1-(-1)^n) = A147677(n) - floor((n+3)/2). - Filip Zaludek, Oct 31 2016

MAPLE

A168195:=n->n+1-3*(-1)^n; seq(A168195(n), n=1..100); # Wesley Ivan Hurt, Dec 13 2013

MATHEMATICA

LinearRecurrence[{1, 1, -1}, {5, 0, 7}, 30] (* Vincenzo Librandi, Feb 27 2012 *)

PROG

(MAGMA) I:=[5, 0, 7]; [n le 3 select I[n] else Self(n-1)+Self(n-2)-Self(n-3): n in [1..40]]; // Vincenzo Librandi, Feb 27 2012

CROSSREFS

Sequence in context: A199062 A070595 A201656 * A244345 A021873 A020801

Adjacent sequences:  A168192 A168193 A168194 * A168196 A168197 A168198

KEYWORD

nonn,easy

AUTHOR

Vincenzo Librandi, Nov 20 2009

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy .

Last modified November 22 15:13 EST 2017. Contains 295089 sequences.