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!)
A065364 Alternating sum of balanced ternary digits in n. Replace 3^k with (-1)^k in balanced ternary expansion of n. 5
1, -2, -1, 0, 1, 2, 3, 0, 1, 2, -1, 0, 1, -2, -1, 0, -3, -2, -1, -4, -3, -2, -1, 0, 1, -2, -1, 0, -3, -2, -1, 0, 1, 2, -1, 0, 1, -2, -1, 0, 1, 2, 3, 0, 1, 2, -1, 0, 1, 2, 3, 4, 1, 2, 3, 0, 1, 2, 3, 4, 5, 2, 3, 4, 1, 2, 3, 0, 1, 2, -1, 0, 1, -2, -1, 0, 1, 2, 3, 0, 1, 2, -1, 0, 1, 2, 3, 4, 1, 2, 3, 0, 1, 2, -1, 0, 1, -2, -1, 0, -3, -2, -1, 0 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
Notation: (3)<n>(-1).
LINKS
EXAMPLE
5 = +1(9)-1(3)-1(1) -> +1(+1)-1(-1)-1(+1) = +1 = a(5).
MATHEMATICA
Array[Total@ MapIndexed[#1 (2 Mod[First[#2], 2] - 1) &, Reverse@ #] &[Prepend[IntegerDigits[#, 3], 0] //. {a___, b_, 2, c___} :> {a, b + 1, -1, c}] &, 104] (* Michael De Vlieger, Jun 27 2020 *)
CROSSREFS
Sequence in context: A058839 A275946 A287824 * A168318 A174203 A353642
KEYWORD
base,easy,sign
AUTHOR
Marc LeBrun, Oct 31 2001
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 19:02 EDT 2024. Contains 371798 sequences. (Running on oeis4.)