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 A268825 #17 Apr 28 2021 01:40:39 %S A268825 0,1,3,2,6,7,4,5,14,15,12,13,26,27,24,25,10,11,8,9,50,51,48,49,18,19, %T A268825 16,17,30,31,28,29,22,23,20,21,98,99,96,97,34,35,32,33,46,47,44,45,38, %U A268825 39,36,37,54,55,52,53,62,63,60,61,42,43,40,41,58,59,56,57,194,195,192,193,66,67,64,65,78,79,76,77,70,71,68,69,86,87 %N A268825 Permutation of nonnegative integers: a(0) = 0, a(n) = A268717(1+A268823(n-1)). %C A268825 The "fourth shifted power" of permutation A268717. %H A268825 Antti Karttunen, <a href="/A268825/b268825.txt">Table of n, a(n) for n = 0..8191</a> %H A268825 Indranil Ghosh, <a href="/A268825/a268825.txt">C program to generate the sequence</a> %H A268825 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a> %F A268825 a(0) = 0, and for n >= 1, a(n) = A268717(1+A268823(n-1)). %t A268825 A003188[n_]:=BitXor[n, Floor[n/2]]; A006068[n_]:=If[n<2, n, Block[{m = A006068[Floor[n/2]]}, 2m + Mod[Mod[n, 2] + Mod[m, 2], 2]]]; A268717[n_]:=If[n<1, 0, A003188[ 1 + A006068[n - 1]]]; A268823[n_]:= If[n<2, n, A268717[1 + A268717[1 + A268717[n - 2]]]]; A268825[n_]:=If[n<1, 0, A268717[1 + A268823[n - 1]]]; Table[A268825[n], {n, 0, 100}] (* _Indranil Ghosh_, Apr 03 2017 *) %o A268825 (Scheme) (define (A268825 n) (if (zero? n) n (A268717 (+ 1 (A268823 (- n 1)))))) %o A268825 (PARI) A003188(n) = bitxor(n, n\2); %o A268825 A006068(n) = if(n<2, n, {my(m = A006068(n\2)); 2*m + (n%2 + m%2)%2}); %o A268825 A268717(n) = if(n<1, 0, A003188(1 + A006068(n - 1))); %o A268825 A268823(n) = if(n<2, n, A268717(1 + A268717(1 + A268717(n - 2)))); %o A268825 for(n=0, 100, print1(if(n<1, 0, A268717(1+A268823(n - 1))),", ")) \\ _Indranil Ghosh_, Apr 03 2017 %o A268825 (Python) %o A268825 def A003188(n): return n^(n//2) %o A268825 def A006068(n): %o A268825 if n<2: return n %o A268825 else: %o A268825 m=A006068(n//2) %o A268825 return 2*m + (n%2 + m%2)%2 %o A268825 def A268717(n): return 0 if n<1 else A003188(1 + A006068(n - 1)) %o A268825 def A268823(n): return A268717(1 + A268717(1 + A268717(n - 2))) if n>1 else n %o A268825 def a(n): return A268717(1 + A268823(n - 1)) if n>0 else 0 %o A268825 print([a(n) for n in range(101)]) # _Indranil Ghosh_, Apr 03 2017 %Y A268825 Inverse: A268826. %Y A268825 Cf. A268717, A268823, A268827. %Y A268825 Row 4 of array A268820. %K A268825 nonn %O A268825 0,3 %A A268825 _Antti Karttunen_, Feb 14 2016