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 A379657 #10 Dec 30 2024 16:07:38 %S A379657 0,1,3,2,5,11,6,13,7,4,9,19,10,21,43,22,45,23,12,25,51,26,53,27,14,29, %T A379657 15,8,17,35,18,37,75,38,77,39,20,41,83,42,85,171,86,173,87,44,89,179, %U A379657 90,181,91,46,93,47,24,49,99,50,101,203,102,205,103,52,105 %N A379657 The nonadjacent form of a(n) is obtained by inserting a digit 0 before each nonzero digit in the balanced ternary expansion of n. %C A379657 A permutation of the nonnegative integers with inverse A379658. %H A379657 Rémy Sigrist, <a href="/A379657/b379657.txt">Table of n, a(n) for n = 0..10000</a> %H A379657 Joerg Arndt, <a href="http://www.jjj.de/fxt/#fxtbook">Matters Computational (The Fxtbook)</a>, pages 61-62. %H A379657 Wikipedia, <a href="https://en.wikipedia.org/wiki/Balanced_ternary">Balanced ternary</a> %H A379657 Wikipedia, <a href="https://en.wikipedia.org/wiki/Non-adjacent_form">Non-adjacent form</a> %H A379657 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a> %F A379657 A334913(a(n)) = A065363(n). %e A379657 The first terms are: n a(n) bter(n) naf(a(n)) %e A379657 -- ---- ------- --------- %e A379657 0 0 0 0 %e A379657 1 1 1 1 %e A379657 2 3 1T 10T %e A379657 3 2 10 10 %e A379657 4 5 11 101 %e A379657 5 11 1TT 10T0T %e A379657 6 6 1T0 10T0 %e A379657 7 13 1T1 10T01 %e A379657 8 7 10T 100T %e A379657 9 4 100 100 %e A379657 10 9 101 1001 %e A379657 11 19 11T 1010T %e A379657 12 10 110 1010 %o A379657 (PARI) a(n) = { my (v = 0, d, b = 1); while (n, d = centerlift(Mod(n, 3)); n = (n-d)/3; %o A379657 v += d * b; b *= if (d, 4, 2);); v; } %Y A379657 See A048680 for a similar sequence. %Y A379657 Cf. A065363, A334913, A379658 (inverse). %K A379657 nonn,base %O A379657 0,3 %A A379657 _Rémy Sigrist_, Dec 29 2024