login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A343602 For any positive number n, the balanced ternary representation of a(n) is obtained by left-rotating the balanced ternary representation of n until a nonzero digit appears again as the leftmost digit; a(0) = 0. 2
0, 1, -2, 3, 4, -11, -8, -5, -6, 9, 12, 7, 10, 13, -38, -35, -32, -29, -26, -23, -20, -17, -14, -33, -24, -15, -18, 27, 36, 21, 30, 39, 16, 19, 22, 25, 28, 31, 34, 37, 40, -119, -116, -113, -110, -107, -104, -101, -98, -95, -92, -89, -86, -83, -80, -77, -74 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
COMMENTS
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 A343601 (after a similar extension to negative indexes).
LINKS
FORMULA
A065363(a(n)) = A065363(n).
A134021(a(n)) = A134021(n).
a^k(n) = n for k = A005812(n) (where a^k denotes the k-th iterate of a).
EXAMPLE
The first terms, in base 10 and in balanced ternary (where T denotes the digit -1), are:
n a(n) bter(n) bter(a(n))
-- ---- ------- ----------
0 0 0 0
1 1 1 1
2 -2 1T T1
3 3 10 10
4 4 11 11
5 -11 1TT TT1
6 -8 1T0 T01
7 -5 1T1 T11
8 -6 10T T10
9 9 100 100
10 12 101 110
11 7 11T 1T1
12 10 110 101
13 13 111 111
14 -38 1TTT TTT1
15 -35 1TT0 TT01
PROG
(PARI) a(n) = { my (d = [], t); while (n, d = concat(t = centerlift(Mod(n, 3)), d); n = (n-t)\3); for (k=2, #d, if (d[k], return (fromdigits(concat(d[k..#d], d[1..k-1]), 3)))); return (fromdigits(d, 3)) }
CROSSREFS
Cf. A005812, A065363, A134021, A139708 (binary variant), A343600 (ternary variant), A343603 (inverse).
Sequence in context: A075833 A265904 A117351 * A357530 A108467 A265565
KEYWORD
sign,base
AUTHOR
Rémy Sigrist, Apr 21 2021
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 16 20:46 EDT 2024. Contains 374358 sequences. (Running on oeis4.)