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 A340717 #11 Jan 22 2021 14:18:42 %S A340717 0,1,1,2,1,3,2,4,1,5,3,6,2,6,4,7,1,8,5,9,3,10,6,11,2,9,6,12,4,11,7,13, %T A340717 1,14,8,15,5,16,9,17,3,16,10,18,6,19,11,20,2,15,9,21,6,18,12,22,4,17, %U A340717 11,22,7,20,13,23,1,24,14,25,8,26,15,27,5,28,16 %N A340717 Lexicographically earliest sequence of nonnegative integers with as many distinct values as possible such that for any n >= 0, a(rev(n)) = a(n) (where rev(n) = A030101(n) corresponds to the binary reversal of n). %C A340717 The condition "with as many distinct values as possible" means here that for any distinct m and n, provided the orbits of m and n under the map x -> rev(x) do not merge, then a(m) <> a(n). %H A340717 Rémy Sigrist, <a href="/A340717/b340717.txt">Table of n, a(n) for n = 0..8191</a> %H A340717 Rémy Sigrist, <a href="/A340717/a340717.png">Colored scatterplot of the first 2^16 terms</a> (where the color is function of A007814(n), the 2-adic valuation of n) %H A340717 Rémy Sigrist, <a href="/A340717/a340717.gp.txt">PARI program for A340717</a> %F A340717 a(2*n) = a(n). %F A340717 a(n) = 1 iff n is a power of 2. %F A340717 a(n) = 2 iff n belongs to A007283. %F A340717 a(n) = 3 iff n belongs to A020714. %F A340717 a(n) = 4 iff n belongs to A005009. %F A340717 a(n) = 5 iff n belongs to A005010. %F A340717 a(A340718(n)) = n (and this is the first occurrence of n in the sequence). %e A340717 The first terms, alongside rev(n), are: %e A340717 n a(n) rev(n) %e A340717 -- ---- ------ %e A340717 0 0 0 %e A340717 1 1 1 %e A340717 2 1 1 %e A340717 3 2 3 %e A340717 4 1 1 %e A340717 5 3 5 %e A340717 6 2 3 %e A340717 7 4 7 %e A340717 8 1 1 %e A340717 9 5 9 %e A340717 10 3 5 %e A340717 11 6 13 %e A340717 12 2 3 %e A340717 13 6 11 %e A340717 14 4 7 %e A340717 15 7 15 %o A340717 (PARI) See Links section. %Y A340717 See A340716 for similar sequences. %Y A340717 Cf. A000079, A005009, A005010, A007283, A007814, A020714, A030101, A340718. %K A340717 nonn,look,base %O A340717 0,4 %A A340717 _Rémy Sigrist_, Jan 17 2021