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 A342102 #17 Jun 02 2025 15:24:03 %S A342102 0,1,2,3,6,5,4,7,14,12,10,13,9,11,8,15,30,28,26,25,24,22,21,29,20,19, %T A342102 18,27,17,23,16,31,62,60,58,56,57,52,50,54,53,49,44,51,42,48,46,61,45, %U A342102 41,38,43,37,40,39,59,35,36,34,55,33,47,32,63,126,124,122 %N A342102 Lexicographically latest sequence of distinct nonnegative integers such that for any n >= 0, {A000120(n), A080791(n)} = {A000120(a(n)), A080791(a(n))}. %C A342102 This sequence is a self-inverse permutation of the nonnegative integers. %H A342102 Rémy Sigrist, <a href="/A342102/b342102.txt">Table of n, a(n) for n = 0..8191</a> %H A342102 Rémy Sigrist, <a href="/A342102/a342102.png">Colored scatterplot of the first 2^20 terms</a> (where the color is function of min(A000120(n), A080791(n))) %H A342102 Rémy Sigrist, <a href="/A342102/a342102.gp.txt">PARI program for A342102</a> %H A342102 <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a> %H A342102 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a> %F A342102 a(2^k-1) = 2^k-1 for any k >= 0. %F A342102 a(n) < 2^k for any n < 2^k. %e A342102 The first terms, in decimal and in binary, alongside {A000120(n), A080791(n)}, are: %e A342102 n a(n) bin(n) bin(a(n)) {A000120(n), A080791(n)} %e A342102 -- ---- ------ --------- ------------------------ %e A342102 0 0 0 0 {0} %e A342102 1 1 1 1 {0, 1} %e A342102 2 2 10 10 {1} %e A342102 3 3 11 11 {0, 2} %e A342102 4 6 100 110 {1, 2} %e A342102 5 5 101 101 {1, 2} %e A342102 6 4 110 100 {1, 2} %e A342102 7 7 111 111 {0, 3} %e A342102 8 14 1000 1110 {1, 3} %e A342102 9 12 1001 1100 {2} %e A342102 10 10 1010 1010 {2} %e A342102 11 13 1011 1101 {1, 3} %e A342102 12 9 1100 1001 {2} %e A342102 13 11 1101 1011 {1, 3} %e A342102 14 8 1110 1000 {1, 3} %e A342102 15 15 1111 1111 {0, 4} %o A342102 (PARI) \\ See Links section. %Y A342102 See A342115, A342116 and A342117 for similar sequences. %Y A342102 Cf. A000120, A080791, A331274, A337242. %K A342102 nonn,base %O A342102 0,3 %A A342102 _Rémy Sigrist_, Feb 28 2021