[go: up one dir, main page]

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!)
A343228 A binary encoding of the digits "+1" in balanced ternary representation of n. 6
0, 1, 2, 2, 3, 4, 4, 5, 4, 4, 5, 6, 6, 7, 8, 8, 9, 8, 8, 9, 10, 10, 11, 8, 8, 9, 8, 8, 9, 10, 10, 11, 12, 12, 13, 12, 12, 13, 14, 14, 15, 16, 16, 17, 16, 16, 17, 18, 18, 19, 16, 16, 17, 16, 16, 17, 18, 18, 19, 20, 20, 21, 20, 20, 21, 22, 22, 23, 16, 16, 17, 16 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
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) = A343229(n) for any n >= 0.
LINKS
Wikipedia, Balanced ternary
FORMULA
a(n) = A289831(A060372(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 1 1 1
2 2 1T 10
3 2 10 10
4 3 11 11
5 4 1TT 100
6 4 1T0 100
7 5 1T1 101
8 4 10T 100
9 4 100 100
10 5 101 101
11 6 11T 110
12 6 110 110
13 7 111 111
14 8 1TTT 1000
15 8 1TT0 1000
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: A209764 A071475 A358104 * A112778 A080594 A207291
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 August 29 09:09 EDT 2024. Contains 375511 sequences. (Running on oeis4.)