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 A379658 #9 Dec 30 2024 16:07:33 %S A379658 0,1,3,2,9,4,6,8,27,10,12,5,18,7,24,26,81,28,30,11,36,13,15,17,54,19, %T A379658 21,23,72,25,78,80,243,82,84,29,90,31,33,35,108,37,39,14,45,16,51,53, %U A379658 162,55,57,20,63,22,69,71,216,73,75,77,234,79,240,242,729 %N A379658 The balanced ternary expansion of a(n) is obtained by removing a digit 0 before each nonzero digit in the nonadjacent form of n. %C A379658 A permutation of the nonnegative integers with inverse A379657. %H A379658 Rémy Sigrist, <a href="/A379658/b379658.txt">Table of n, a(n) for n = 0..10000</a> %H A379658 Joerg Arndt, <a href="http://www.jjj.de/fxt/#fxtbook">Matters Computational (The Fxtbook)</a>, pages 61-62. %H A379658 Wikipedia, <a href="https://en.wikipedia.org/wiki/Balanced_ternary">Balanced ternary</a> %H A379658 Wikipedia, <a href="https://en.wikipedia.org/wiki/Non-adjacent_form">Non-adjacent form</a> %H A379658 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a> %F A379658 A065363(a(n)) = A334913(n). %e A379658 The first terms are: %e A379658 n a(n) naf(n) bter(a(n)) %e A379658 -- ---- ------ ---------- %e A379658 0 0 0 0 %e A379658 1 1 1 1 %e A379658 2 3 10 10 %e A379658 3 2 10T 1T %e A379658 4 9 100 100 %e A379658 5 4 101 11 %e A379658 6 6 10T0 1T0 %e A379658 7 8 100T 10T %e A379658 8 27 1000 1000 %e A379658 9 10 1001 101 %e A379658 10 12 1010 110 %e A379658 11 5 10T0T 1TT %e A379658 12 18 10T00 1T00 %o A379658 (PARI) a(n) = { my (v = 0, t = 1, d); while (n, if (n%2, n -= d = 2 - (n%4); v += d*t; t /= 3;); n \= 2; t *= 3;); return (v); } %Y A379658 See A048679 for a similar sequence. %Y A379658 Cf. A065363, A334913, A379657 (inverse). %K A379658 nonn,base %O A379658 0,3 %A A379658 _Rémy Sigrist_, Dec 29 2024