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