cp's OEIS Frontend

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.

A343603 For any positive number n, the balanced ternary representation of a(n) is obtained by right-rotating the balanced ternary representation of n until a nonzero digit appears again as the leftmost digit; a(0) = 0.

This page as a plain text file.
%I A343603 #12 Apr 23 2021 01:20:39
%S A343603 0,1,-2,3,4,-7,-8,11,-6,9,12,-5,10,13,-22,-25,32,-21,-26,33,-20,29,34,
%T A343603 -19,-24,35,-18,27,36,-17,30,37,-16,-23,38,-15,28,39,-14,31,40,-67,
%U A343603 -76,95,-66,-79,96,-65,86,97,-64,-75,98,-63,-80,99,-62,87,100,-61
%N A343603 For any positive number n, the balanced ternary representation of a(n) is obtained by right-rotating the balanced ternary representation of n until a nonzero digit appears again as the leftmost digit; a(0) = 0.
%C A343603 This sequence can be extended to negative indexes by setting a(-n) = -a(n) for any n > 0. We then obtain a permutation of the integers (Z) with inverse A343602 (after a similar extension to negative indexes).
%H A343603 Rémy Sigrist, <a href="/A343603/b343603.txt">Table of n, a(n) for n = 0..9841</a>
%F A343603 A065363(a(n)) = A065363(n).
%F A343603 A134021(a(n)) = A134021(n).
%F A343603 a^k(n) = n for k = A005812(n) (where a^k denotes the k-th iterate of a).
%e A343603 The first terms, in base 10 and in balanced ternary (where T denotes the digit -1), are:
%e A343603   n   a(n)  bter(n)  bter(a(n))
%e A343603   --  ----  -------  ----------
%e A343603    0     0        0           0
%e A343603    1     1        1           1
%e A343603    2    -2       1T          T1
%e A343603    3     3       10          10
%e A343603    4     4       11          11
%e A343603    5    -7      1TT         T1T
%e A343603    6    -8      1T0         T01
%e A343603    7    11      1T1         11T
%e A343603    8    -6      10T         T10
%e A343603    9     9      100         100
%e A343603   10    12      101         110
%e A343603   11    -5      11T         T11
%e A343603   12    10      110         101
%e A343603   13    13      111         111
%e A343603   14   -22     1TTT        T1TT
%e A343603   15   -25     1TT0        T01T
%o A343603 (PARI) a(n) = { my (d = [], t); while (n, d = concat(t = centerlift(Mod(n,3)), d); n = (n-t)\3); forstep (k=#d, 1, -1, if (d[k], return (fromdigits(concat(d[k..#d], d[1..k-1]), 3)))); return (fromdigits(d, 3)) }
%Y A343603 Cf. A005812, A065363, A134021, A139706 (binary variant), A343601 (ternary variant), A343602 (inverse).
%K A343603 sign,base
%O A343603 0,3
%A A343603 _Rémy Sigrist_, Apr 21 2021