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 A263449 #45 Nov 28 2023 11:00:12 %S A263449 1,4,3,2,5,8,7,6,9,12,11,10,13,16,15,14,17,20,19,18,21,24,23,22,25,28, %T A263449 27,26,29,32,31,30,33,36,35,34,37,40,39,38,41,44,43,42,45,48,47,46,49, %U A263449 52,51,50,53,56,55,54,57,60,59,58,61,64,63,62,65,68,67 %N A263449 Permutation of the natural numbers: [4k+1, 4k+4, 4k+3, 4k+2, ...]. %C A263449 From _Franklin T. Adams-Watters_, Jul 13 2017: (Start) %C A263449 For this to be a permutation, it should have offset one, not zero. %C A263449 With offset 1, a(n) is the smallest positive integer == n (mod 2) with a(n) != a(n-1) + 1. (End) %H A263449 Colin Barker, <a href="/A263449/b263449.txt">Table of n, a(n) for n = 0..1000</a> %H A263449 <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (2,-2,2,-1). %H A263449 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>. %F A263449 G.f.: (1+2*x-3*x^2+2*x^3)/((x-1)^2*(1+x^2)). %F A263449 a(n) = 2*a(n-1)-2*a(n-2)+2*a(n-3)-a(n-4) for n>3. %F A263449 a(n) = n+1+(1-(-1)^n)*(-1)^(n*(n-1)/2). %F A263449 a(2n) = A005408(n), a(2n+1) = 2*A014681(n+1). %F A263449 a(n) = n+1+i*((-i)^n-i^n), where i=sqrt(-1). - _Colin Barker_, Oct 27 2015 %F A263449 a(n) = 4*ceiling(n/4) - (n mod 4) + 1. - _Wesley Ivan Hurt_, Nov 07 2015 %F A263449 Sum_{n>=0} (-1)^n/a(n) = log(2) (A002162). - _Amiram Eldar_, Nov 28 2023 %p A263449 A263449:=n->n+1+(1-(-1)^n)*(-1)^(n*(n-1)/2): seq(A263449(n), n=0..100); %t A263449 Table[n + 1 + (1 - (-1)^n) (-1)^(n (n - 1)/2), {n, 0, 100}] (* or *) LinearRecurrence[{2,-2,2,-1}, {1, 4, 3, 2}, 70] %o A263449 (Magma) [n+1+(1-(-1)^n)*(-1)^(n*(n-1) div 4) : n in [0..100]]; %o A263449 (Magma) /* By definition: */ &cat[[4*k+1,4*k+4,4*k+3,4*k+2]: k in [0..20]]; // _Bruno Berselli_, Oct 19 2015 %o A263449 (PARI) Vec((1+2*x-3*x^2+2*x^3)/((x-1)^2*(1+x^2)) + O(x^100)) \\ _Altug Alkan_, Oct 19 2015 %o A263449 (PARI) a(n) = n+1+I*((-I)^n-I^n) \\ _Colin Barker_, Oct 27 2015 %Y A263449 Cf. A002162, A005408, A014681. %K A263449 nonn,easy %O A263449 0,2 %A A263449 _Wesley Ivan Hurt_, Oct 18 2015