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 A298364 #37 Dec 12 2018 13:45:35 %S A298364 2,3,1,4,6,7,5,8,10,11,9,12,14,15,13,16,18,19,17,20,22,23,21,24,26,27, %T A298364 25,28,30,31,29,32,34,35,33,36,38,39,37,40,42,43,41,44,46,47,45,48,50, %U A298364 51,49,52,54,55,53,56,58,59,57,60,62,63,61,64,66,67,65 %N A298364 Permutation of the natural numbers partitioned into quadruples [4k-2, 4k-1, 4k-3, 4k] for k > 0. %C A298364 Partition the natural number sequence into quadruples starting with (1,2,3,4); swap the first and second elements, then swap the second and third elements; repeat for all quadruples. %H A298364 Guenther Schrack, <a href="/A298364/b298364.txt">Table of n, a(n) for n = 1..10000</a> %H A298364 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a> %H A298364 <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (1,0,0,1,-1). %F A298364 O.g.f.: (3*x^3 - 2*x^2 + x + 2)/(x^5 - x^4 - x - 1). %F A298364 a(1) = 2, a(2) = 3, a(3) = 1, a(4) = 4, a(n) = a(n-4) + 4 for n > 4. %F A298364 a(n) = n + ((-1)^n + ((-1)^(n*(n-1)/2))*(1 - 2*(-1)^n))/2. %F A298364 a(n) = n + (cos(n*Pi) - cos(n*Pi/2) + 3*sin(n*Pi/2))/2. %F A298364 a(n) = 2*floor((n+1)/2) - 4*floor((n+1)/4) + floor(n/2) + 2*floor(n/4). %F A298364 a(n) = n + (-1)^floor((n-1)^2/4)*A140081(n) for n > 0. %F A298364 a(n) = A056699(n+1) - 1, n > 0. %F A298364 a(n+2) = A168269(n+1) - a(n), n > 0. %F A298364 a(n+2) = a(n) + (-1)^floor((n+1)^2/4)*A132400(n+2) for n > 0. %F A298364 Linear recurrence: a(n) = a(n-1) + a(n-4) - a(n-5) for n > 5. %F A298364 First differences: periodic, (1, -2, 3, 2) repeat. %F A298364 Compositions: %F A298364 a(n) = A080412(A116966(n-1)) for n > 0. %F A298364 a(n) = A284307(A256008(n)) for n > 0. %F A298364 a(A067060(n)) = A133256(n) for n > 0. %F A298364 A116966(a(n+1)-1) = A092486(n) for n >= 0. %F A298364 A056699(a(n)) = A256008(n) for n > 0. %t A298364 Nest[Append[#, #[[-4]] + 4] &, {2, 3, 1, 4}, 63] (* or *) %t A298364 Array[# + ((-1)^# + ((-1)^(# (# - 1)/2)) (1 - 2 (-1)^#))/2 &, 67] (* _Michael De Vlieger_, Jan 23 2018 *) %t A298364 LinearRecurrence[{1,0,0,1,-1},{2,3,1,4,6},70] (* _Harvey P. Dale_, Dec 12 2018 *) %o A298364 (MATLAB) a = [2 3 1 4]; %o A298364 max = 10000; % Generation of b-file. %o A298364 for n := 5:max %o A298364 a(n) = a(n-4) + 4; %o A298364 end; %o A298364 (PARI) for(n=1, 100, print1(n + ((-1)^n + ((-1)^(n*(n-1)/2))*(1 - 2*(-1)^n))/2, ", ")) %Y A298364 Inverse: A292576. %Y A298364 Sequence of fixed points: A008586(n) for n > 0. %Y A298364 First differences: (-1)^floor(n^2/4)*A068073(n-1) for n > 0. %Y A298364 Subsequences: %Y A298364 elements with odd index: A042963(A103889(n)) for n > 0. %Y A298364 elements with even index A014601(n) for n > 0. %Y A298364 odd elements: A166519(n-1) for n > 0. %Y A298364 indices of odd elements: A042964(n) for n > 0. %Y A298364 even elements: A005843(n) for n > 0. %Y A298364 indices of even elements: A042948(n) for n > 0. %Y A298364 Other similar permutations: A116966, A284307, A292576. %K A298364 nonn,easy %O A298364 1,1 %A A298364 _Guenther Schrack_, Jan 18 2018