The OEIS is supported by the many generous donors to the OEIS Foundation. Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A084964 Follow n+2 by n. Also solution of a(n+2)=a(n)+1, a(0)=2, a(1)=0. 26
 2, 0, 3, 1, 4, 2, 5, 3, 6, 4, 7, 5, 8, 6, 9, 7, 10, 8, 11, 9, 12, 10, 13, 11, 14, 12, 15, 13, 16, 14, 17, 15, 18, 16, 19, 17, 20, 18, 21, 19, 22, 20, 23, 21, 24, 22, 25, 23, 26, 24, 27, 25, 28, 26, 29, 27, 30, 28, 31, 29, 32, 30, 33, 31, 34, 32, 35, 33, 36, 34, 37, 35, 38, 36, 39 (list; graph; refs; listen; history; text; internal format)
 OFFSET 0,1 LINKS Index entries for linear recurrences with constant coefficients, signature (1, 1, -1). FORMULA G.f.: (2-2x+x^2)/((1-x)(1-x^2)). a(2n+1)=n. a(2n)=n+2. a(n+2)=a(n)+1. a(n)=-a(-3-n). a(n) = floor(n/2) + 1 + (-1)^n. - Reinhard Zumkeller, Aug 27 2005 A112032(n)=2^a(n); A112033(n)=3*2^a(n); a(n)=A109613(n+2)-A052938(n). - Reinhard Zumkeller, Aug 27 2005 a(n) = n + 1 - a(n-1) (with a(0)=2). - Vincenzo Librandi, Aug 08 2010 a(n) = floor(n/2)*3 - floor((n-1)/2)*2. - Ross La Haye, Mar 27 2013 a(n) = 3*n - 3 - 5*floor((n-1)/2). - Wesley Ivan Hurt, Nov 08 2013 a(n) = (3 + 5*(-1)^n + 2*n)/4. - Wolfgang Hintze, Dec 13 2014 MAPLE A084964:=n->floor(n/2)+1+(-1)^n; seq(A084964(k), k=0..100); # Wesley Ivan Hurt, Nov 08 2013 MATHEMATICA lst={}; a=1; Do[a=n-a; AppendTo[lst, a], {n, 0, 100}]; lst (* Vladimir Joseph Stephan Orlovsky, Dec 14 2008 *) Table[{n, n-2}, {n, 2, 40}]//Flatten (* or *) LinearRecurrence[{1, 1, -1}, {2, 0, 3}, 80] (* Harvey P. Dale, Sep 12 2021 *) PROG (PARI) a(n)=n\2-2*(n%2)+2 (Magma) &cat[ [n+2, n]: n in [0..37] ]; [Klaus Brockhaus, Nov 23 2009] (Haskell) import Data.List (transpose) a084964 n = a084964_list !! n a084964_list = concat \$ transpose [[2..], [0..]] -- Reinhard Zumkeller, Apr 06 2015 CROSSREFS Cf. A030451, A097065, A152832. Cf. A217764(1,n) = a(n+2). Sequence in context: A195826 A331478 A097065 * A267182 A008720 A340622 Adjacent sequences:  A084961 A084962 A084963 * A084965 A084966 A084967 KEYWORD nonn,easy AUTHOR Michael Somos, Jun 15 2003 EXTENSIONS First part of definition adjusted to match offset by Klaus Brockhaus, Nov 23 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 | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified September 24 17:17 EDT 2022. Contains 356945 sequences. (Running on oeis4.)