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 A351702 #16 Feb 24 2022 22:53:28 %S A351702 0,1,2,3,4,5,8,11,6,9,12,7,10,13,14,23,32,17,26,35,20,29,38,15,24,33, %T A351702 18,27,36,21,30,39,16,25,34,19,28,37,22,31,40,41,68,95,50,77,104,59, %U A351702 86,113,44,71,98,53,80,107,62,89,116,47,74,101,56,83,110,65,92 %N A351702 In the balanced ternary representation of n, reverse the order of digits other than the most significant. %C A351702 Self-inverse permutation with swaps confined to terms of a given digit length (A134021) so within blocks n = (3^k+1)/2 .. (3^(k+1)-1)/2. %C A351702 Can extend to negative n by a(-n) = -a(n). %C A351702 A072998 is balanced ternary coded in decimal digits so that reversal except first digit of A072998(n) is at A072998(a(n)). Similarly its ternary equivalent A157671, and also A132141 ternary starting with 1. %C A351702 These sequences all have a fixed initial digit followed by all ternary strings which is the reversed part. A007932 is such strings as decimal digits 1,2,3 but it omits the empty string so the whole reversal of A007932(n) is at A007932(a(n+1)-1). %C A351702 Fixed points a(n) = n are where n in balanced ternary is a palindrome apart from its initial 1. These are the full balanced ternary palindromes with their least significant 1 removed, so all n = (A134027(m)-1)/3 for m>=2. %H A351702 Kevin Ryde, <a href="/A351702/b351702.txt">Table of n, a(n) for n = 0..9841</a> %H A351702 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the nonnegative integers</a> %e A351702 n = 224 = balanced ternary 1, 0, -1, 1, 0, -1 %e A351702 reverse ^^^^^^^^^^^^^^^^ %e A351702 a(n) = 168 = balanced ternary 1, -1, 0, 1, -1, 0 %o A351702 (PARI) a(n) = if(n==0,0, my(k=if(n,logint(n<<1,3)), s=(3^k+1)>>1); s + fromdigits(Vec(Vecrev(digits(n-s,3)),k),3)); %Y A351702 Cf. A059095 (balanced ternary), A134028 (full reverse), A134027 (palindromes). %Y A351702 Cf. A072998, A157671, A132141, A007932. %Y A351702 In other bases: A059893 (binary), A343150 (Zeckendorf), A343152 (lazy Fibonacci). %K A351702 nonn,base,easy %O A351702 0,3 %A A351702 _Kevin Ryde_, Feb 19 2022