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 A361947 #10 Apr 02 2023 10:06:05 %S A361947 0,1,2,3,4,5,14,11,8,13,10,7,12,9,6,15,16,17,50,35,20,21,62,43,56,29, %T A361947 58,39,44,25,54,47,32,49,34,19,52,53,46,27,40,61,42,23,28,57,38,31,48, %U A361947 33,18,51,36,37,30,59,24,45,26,55,60,41,22,63,64,65,194 %N A361947 If the rightmost nonzero digit in the base-4 expansion of n is the digit 1, then replace 2's by 3's and vice versa; if it is the digit 2, then replace 1's by 3's and vice versa; if it is the digit 3, then replace 1's by 2's and vice versa; a(0) = 0. %C A361947 This sequence is a self-inverse permutation of the nonnegative integers. %H A361947 Rémy Sigrist, <a href="/A361947/b361947.txt">Table of n, a(n) for n = 0..16384</a> %H A361947 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a> %F A361947 a(n) = A163241(n) when A065882(n) = 1. %F A361947 a(n) = A048647(n) when A065882(n) = 2. %F A361947 a(n) = A057300(n) when A065882(n) = 3. %F A361947 a(n) = n iff n = d * A000695(k) for some d in {1, 2, 3} and some k >= 0. %e A361947 For n = 539: %e A361947 - the base-4 expansion of 539 is "20123", %e A361947 - the rightmost nonzero digit is 3, so we replace 1's by 2's and vice versa, %e A361947 - so the base-4 expansion of a(539) is "10213", and a(539) = 295. %o A361947 (PARI) a(n) = { my (m = if (n, [ [0,1,3,2], [0,3,2,1], [0,2,1,3] ][(n / 4^valuation(n, 4)) % 4], [0,1,2,3])); fromdigits(apply (d -> m[1+d], digits(n, 4)), 4); } %Y A361947 Cf. A000695, A048647, A057300, A065882, A163241, A361945, A361946. %K A361947 nonn,look,base %O A361947 0,3 %A A361947 _Rémy Sigrist_, Apr 01 2023