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 A343601 #12 Apr 23 2021 01:20:31 %S A343601 0,1,2,3,4,7,6,5,8,9,12,21,10,13,22,19,14,23,18,15,24,11,16,25,20,17, %T A343601 26,27,36,63,30,37,64,57,38,65,28,39,66,31,40,67,58,41,68,55,42,69,32, %U A343601 43,70,59,44,71,54,45,72,33,46,73,60,47,74,29,48,75,34,49 %N A343601 For any positive number n, the ternary representation of a(n) is obtained by right-rotating the ternary representation of n until a nonzero digit appears again as the leftmost digit; a(0) = 0. %C A343601 This sequence is a permutation of the nonnegative integers with inverse A343600. %H A343601 Rémy Sigrist, <a href="/A343601/b343601.txt">Table of n, a(n) for n = 0..6561</a> %H A343601 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a> %F A343601 A053735(a(n)) = A053735(n). %F A343601 A081604(a(n)) = A081604(n). %F A343601 a^k(n) = n for k = A160384(n) (where a^k denotes the k-th iterate of a). %e A343601 The first terms, in base 10 and in base 3, are: %e A343601 n a(n) ter(n) ter(a(n)) %e A343601 -- ---- ------ --------- %e A343601 0 0 0 0 %e A343601 1 1 1 1 %e A343601 2 2 2 2 %e A343601 3 3 10 10 %e A343601 4 4 11 11 %e A343601 5 7 12 21 %e A343601 6 6 20 20 %e A343601 7 5 21 12 %e A343601 8 8 22 22 %e A343601 9 9 100 100 %e A343601 10 12 101 110 %e A343601 11 21 102 210 %e A343601 12 10 110 101 %e A343601 13 13 111 111 %e A343601 14 22 112 211 %o A343601 (PARI) a(n, base=3) = { my (d=digits(n, base)); forstep (k=#d, 2, -1, if (d[k], return (fromdigits(concat(d[k..#d], d[1..k-1]), base)))); n } %Y A343601 Cf. A053735, A081604, A139706 (binary variant), A160384, A343600 (inverse). %K A343601 nonn,base %O A343601 0,3 %A A343601 _Rémy Sigrist_, Apr 21 2021