OFFSET
1,2
COMMENTS
Notation: (3)<n>(-1).
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..10000
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
KEYWORD
base,easy,sign
AUTHOR
Marc LeBrun, Oct 31 2001
STATUS
approved