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 A353826 #10 May 10 2022 02:26:32 %S A353826 0,1,2,3,4,8,6,7,5,9,10,20,12,13,26,24,25,14,18,19,11,21,22,17,15,16, %T A353826 23,27,28,56,30,31,62,60,61,32,36,37,74,39,40,80,78,79,41,72,73,38,75, %U A353826 76,44,42,43,77,54,55,29,57,58,35,33,34,59,63,64,47,66,67 %N A353826 The positions of nonzero digits in the ternary expansions of n and a(n) are the same, and the k-th rightmost nonzero digit in a(n) equals modulo 3 the product of the k rightmost nonzero digits in n. %C A353826 This sequence is a permutation of the nonnegative integers with inverse A353827. %C A353826 A number is a fixed point of this sequence iff it has at most one digit 2 in its ternary expansion, that digit 2 being its leftmost nonzero digit. %H A353826 Rémy Sigrist, <a href="/A353826/b353826.txt">Table of n, a(n) for n = 0..6561</a> %H A353826 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a> %F A353826 a(3*n) = 3*a(n). %F A353826 a(3*n + 1) = 3*a(n) + 1. %e A353826 The first terms, in decimal and in ternary, are: %e A353826 n a(n) ter(n) ter(a(n)) %e A353826 -- ---- ------ --------- %e A353826 0 0 0 0 %e A353826 1 1 1 1 %e A353826 2 2 2 2 %e A353826 3 3 10 10 %e A353826 4 4 11 11 %e A353826 5 8 12 22 %e A353826 6 6 20 20 %e A353826 7 7 21 21 %e A353826 8 5 22 12 %e A353826 9 9 100 100 %e A353826 10 10 101 101 %e A353826 11 20 102 202 %e A353826 12 12 110 110 %o A353826 (PARI) a(n) = { my (d=digits(n,3), p=1); forstep (k=#d, 1, -1, if (d[k], d[k]=p*=d[k])); fromdigits(d%3,3) } %Y A353826 See A305458, A353824, A353828, A353830 for similar sequences. %Y A353826 Cf. A353827 (inverse). %K A353826 nonn,base %O A353826 0,3 %A A353826 _Rémy Sigrist_, May 08 2022