This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A014681 #56 Sep 04 2022 09:47:08 %S A014681 0,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, %T A014681 25,28,27,30,29,32,31,34,33,36,35,38,37,40,39,42,41,44,43,46,45,48,47, %U A014681 50,49,52,51,54,53,56,55,58,57,60,59,62,61,64,63,66,65,68,67,70 %N A014681 Fix 0; exchange even and odd numbers. %C A014681 A self-inverse permutation of the nonnegative numbers. %C A014681 If we ignore the first term 0, then this can be obtained as: a(n) is the smallest number different from n, not occurring earlier and coprime to n. - _Amarnath Murthy_, Apr 16 2003 [Corrected by _Alois P. Heinz_, May 06 2015] %C A014681 a(0)=0, a(1)=2, then repeatedly subtract 1 and then add 3. - _Jon Perry_, Aug 12 2014 %C A014681 The biggest term of the pair [a(n), a(n+1)] is always even. This is the lexicographically first sequence with this property starting with a(1) = 0 and always extented with the smallest integer not yet present. - _Eric Angelini_, Feb 20 2017 %H A014681 Derek Orr, <a href="/A014681/b014681.txt">Table of n, a(n) for n = 0..10000</a> %H A014681 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a> %H A014681 <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (1,1,-1). %F A014681 G.f.: x*(2-x+x^2)/((1-x)*(1-x^2)). - _N. J. A. Sloane_ %F A014681 a(n) = n - (-1)^n = a(n-1) + a(n-2) - a(n-3) = a(n-2) + 2. - _Henry Bottomley_, Mar 29 2000 %F A014681 a(0) = 0; a(2m+1) = 2m+2; for m > 0 a(2m) = 2m - 1. - _George E. Antoniou_, Dec 04 2001 %F A014681 a(n) = n - (-1)^n + 0^n for n >= 0. - _Bruno Berselli_, Nov 16 2010 %F A014681 E.g.f.: 1 + (x - 1)*cosh(x) + (1 + x)*sinh(x). - _Stefano Spezia_, Sep 02 2022 %t A014681 Table[n - (-1)^n, {n, 1, 60}] %t A014681 Join[{0},LinearRecurrence[{1, 1, -1},{2, 1, 4},69]] (* _Ray Chandler_, Sep 03 2015 *) %o A014681 (PARI) a(n)=n - (-1)^n \\ _Charles R Greathouse IV_, May 06 2015 %Y A014681 Composing this permutation with A065190 gives A065164. %Y A014681 Equals 1 + A004442. %Y A014681 Cf. A103889. %K A014681 nonn,easy %O A014681 0,2 %A A014681 _Mohammad K. Azarian_