This site is supported by donations to The OEIS Foundation.

 Please make a donation to keep the OEIS running. We are now in our 55th year. In the past year we added 12000 new sequences and reached 8000 citations (which often say "discovered thanks to the OEIS"). We need to raise money to hire someone to manage submissions, which would reduce the load on our editors and speed up editing. Other ways to donate

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A103889 Odd and even positive integers swapped. 26

%I

%S 2,1,4,3,6,5,8,7,10,9,12,11,14,13,16,15,18,17,20,19,22,21,24,23,26,25,

%T 28,27,30,29,32,31,34,33,36,35,38,37,40,39,42,41,44,43,46,45,48,47,50,

%U 49,52,51,54,53,56,55,58,57,60,59,62,61,64,63,66,65,68,67,70,69,72,71

%N Odd and even positive integers swapped.

%C (a(n)-1)*(a(n-1)+1) = 2*A176222(n+1) for n>1; (a(n)-1)*(a(n-3)+1) = 2*A176222(n) for n>3. - _Bruno Berselli_, Nov 16 2010

%C For n >= 5, also the number of (undirected) Hamiltonian cycles in the (n-2)-Moebius ladder. - _Eric W. Weisstein_, May 06 2019

%C For n >= 4, also the number of (undirected) Hamiltonian cycles in the (n-1)-prism graph. - _Eric W. Weisstein_, May 06 2019

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/HamiltonianCycle.html">Hamiltonian Cycle</a>

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/MoebiusLadder.html">Moebius Ladder</a>

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/PrismGraph.html">Prism Graph</a>

%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (1,1,-1).

%F a(2k) = 2k-1 = A005408(k), a(2k-1) = 2k = A005843(k), k=1, 2, ...

%F O.g.f.: x*(x^2-x+2)/[(x-1)^2*(1+x)]. - _R. J. Mathar_, Apr 06 2008

%F a(n) = n-1+2*(n mod 2). - _Rolf Pleisch_, Apr 22 2008

%F a(n) = 2*n-a(n-1)-1 (with a(1)=2). - _Vincenzo Librandi_, Nov 16 2010

%F a(n) = n-(-1)^n. a(n)-a(n-1)-a(n-2)+a(n-3) = 0 for n>3. - _Bruno Berselli_, Nov 16 2010

%t Table[{n + 1, n}, {n, 1, 100, 2}] // Flatten

%t Table[n - (-1)^n, {n, 25}] (* _Eric W. Weisstein_, May 06 2019 *)

%o [ n eq 1 select 2 else -Self(n-1)+2*n-1: n in [1..72] ];

%o (Haskell)

%o import Data.List (transpose)

%o a103889 n = n - 1 + 2 * mod n 2

%o a103889_list = concat \$ transpose [tail a005843_list, a005408_list]

%o -- _Reinhard Zumkeller_, Jun 23 2013, Feb 21 2011

%o (PARI) a(n)=n-1+if(n%2,2) \\ _Charles R Greathouse IV_, Feb 24 2011

%Y Essentially the same as A014681.

%Y Odd numbers: A005408. Even numbers: A005843.

%Y Cf. A103889, A004442.

%K nonn,easy

%O 1,1

%A _Zak Seidov_, Feb 20 2005

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

Last modified December 14 19:27 EST 2019. Contains 329987 sequences. (Running on oeis4.)