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 A190128 #16 Feb 16 2025 08:33:14 %S A190128 1,3,9,27,81,243,729,2187,6561,6562,6563,2188,6564,6565,6566,2189, %T A190128 6567,6568,6569,730,2190,6570,6571,6572,2191,6573,6574,6575,2192,6576, %U A190128 6577,6578,731,2193,6579,6580,6581,2194,6582,6583,6584,2195,6585,6586,6587,244 %N A190128 Numbers 1 through 10000 sorted lexicographically in ternary representation. %C A190128 A190129 = inverse permutation: a(A190129(n)) = A190129(a(n)) = n; %C A190128 a(n) <> n for n > 1. %H A190128 Reinhard Zumkeller, <a href="/A190128/b190128.txt">Table of n, a(n) for n = 1..10000</a> (full sequence) %H A190128 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/LexicographicOrder.html">Lexicographic Order</a> %H A190128 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/Ternary.html">Ternary</a> %H A190128 Wikipedia, <a href="http://en.wikipedia.org/wiki/Lexicographical_order">Lexicographical order</a> %H A190128 Wikipedia, <a href="http://en.wikipedia.org/wiki/Ternary_numeral_system">Ternary numeral system</a> %e A190128 a(12) = 2188 -> 10000001 [tern]; %e A190128 a(13) = 6564 -> 100000010 [tern]; %e A190128 a(14) = 6565 -> 100000011 [tern]; %e A190128 a(15) = 6566 -> 100000012 [tern]; %e A190128 a(16) = 2189 -> 10000002 [tern]; %e A190128 a(17) = 6567 -> 100000020 [tern]; %e A190128 a(18) = 6568 -> 100000021 [tern]; %e A190128 a(19) = 6569 -> 100000022 [tern]; %e A190128 a(20) = 730 -> 1000001 [tern]; %e A190128 a(21) = 2190 -> 10000010 [tern]; %e A190128 largest term a(5164) = 10000 -> 111201101 [tern]; %e A190128 last term a(10000) = 6560 -> 22222222 [tern], largest term lexicographically. %o A190128 (Haskell) %o A190128 import Data.Ord (comparing) %o A190128 import Data.List (sortBy) %o A190128 a190128 n = a190128_list !! (n-1) %o A190128 a190128_list = sortBy (comparing (show . a007089)) [1..10000] %Y A190128 Cf. A007089; A190126 (base 2), A190130 (base 8), A190016 (base 10), A190132 (base 12), A190134 (base 16). %K A190128 nonn,base,fini,full %O A190128 1,2 %A A190128 _Reinhard Zumkeller_, May 06 2011