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 A321524 #9 Nov 14 2018 17:08:06 %S A321524 0,1,2,3,4,7,6,5,8,9,10,19,12,13,22,21,14,23,18,11,20,15,16,25,24,17, %T A321524 26,27,28,55,30,31,58,57,32,59,36,37,64,39,40,67,66,41,68,63,38,65,42, %U A321524 43,70,69,44,71,54,29,56,33,34,61,60,35,62,45,46,73,48,49 %N A321524 Right-rotate nonzero digits in ternary expansion of n and convert back to decimal. %C A321524 This sequence is a permutation of the nonnegative integers with inverse A321525. %H A321524 Rémy Sigrist, <a href="/A321524/b321524.txt">Table of n, a(n) for n = 0..6561</a> %H A321524 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a> %F A321524 a(3 * n) = 3 * a(n). %e A321524 The first terms, alongside the corresponding ternary representations, are: %e A321524 n a(n) ter(n) ter(a(n)) %e A321524 -- ---- ------ --------- %e A321524 0 0 0 0 %e A321524 1 1 1 1 %e A321524 2 2 2 2 %e A321524 3 3 10 10 %e A321524 4 4 11 11 %e A321524 5 7 12 21 %e A321524 6 6 20 20 %e A321524 7 5 21 12 %e A321524 8 8 22 22 %e A321524 9 9 100 100 %e A321524 10 10 101 101 %e A321524 11 19 102 201 %e A321524 12 12 110 110 %e A321524 13 13 111 111 %e A321524 14 22 112 211 %e A321524 15 21 120 210 %e A321524 16 14 121 112 %e A321524 17 23 122 212 %o A321524 (PARI) a(n, base=3) = my (d=digits(n, base), t=select(sign, d), i=-2); for (j=1, #d, if (d[j], d[j]=t[1+(i++%#t)])); fromdigits(d, base) %Y A321524 Cf. A321464, A321525 (inverse). %K A321524 nonn,base %O A321524 0,3 %A A321524 _Rémy Sigrist_, Nov 12 2018