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!)
A343229 A binary encoding of the digits "-1" in balanced ternary representation of n. 5
0, 0, 1, 0, 0, 3, 2, 2, 1, 0, 0, 1, 0, 0, 7, 6, 6, 5, 4, 4, 5, 4, 4, 3, 2, 2, 1, 0, 0, 1, 0, 0, 3, 2, 2, 1, 0, 0, 1, 0, 0, 15, 14, 14, 13, 12, 12, 13, 12, 12, 11, 10, 10, 9, 8, 8, 9, 8, 8, 11, 10, 10, 9, 8, 8, 9, 8, 8, 7, 6, 6, 5, 4, 4, 5, 4, 4, 3, 2, 2, 1, 0 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,6
COMMENTS
The ones in the binary representation of a(n) correspond to the digits "-1" in the balanced ternary representation of n.
We can extend this sequence to negative indices: a(-n) = A343228(n) for any n >= 0.
LINKS
Wikipedia, Balanced ternary
FORMULA
a(n) = A289831(A060373(n)).
EXAMPLE
The first terms, alongside the balanced ternary representation of n (with "T" instead of digits "-1") and the binary representation of a(n), are:
n a(n) ter(n) bin(a(n))
-- ---- ------ ---------
0 0 0 0
1 0 1 0
2 1 1T 1
3 0 10 0
4 0 11 0
5 3 1TT 11
6 2 1T0 10
7 2 1T1 10
8 1 10T 1
9 0 100 0
10 0 101 0
11 1 11T 1
12 0 110 0
13 0 111 0
14 7 1TTT 111
15 6 1TT0 110
PROG
(PARI) a(n) = { my (v=0, b=1, t); while (n, t=centerlift(Mod(n, 3)); if (t==-1, v+=b); n=(n-t)\3; b*=2); v }
CROSSREFS
Sequence in context: A323557 A155917 A291770 * A287823 A143378 A131961
KEYWORD
nonn,look,base
AUTHOR
Rémy Sigrist, Apr 08 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 April 19 14:10 EDT 2024. Contains 371792 sequences. (Running on oeis4.)