OFFSET
0,4
COMMENTS
LINKS
Rémy Sigrist, Table of n, a(n) for n = 0..6561
FORMULA
EXAMPLE
For n = 97:
- 97 = 3^4 + 3^2 + 2*3^1 + 3^0,
- hence a(97) = 3^4 - 3^2 + (-1)*3^1 - 3^0 = 68.
PROG
(PARI) a(n) = { my (v=0, t=Vecrev(digits(n, 3))); for (k=1, #t, if (t[k]==1, v=+3^(k-1)-v, t[k]==2, v=-3^(k-1)-v)); v }
CROSSREFS
KEYWORD
sign,base
AUTHOR
Rémy Sigrist, Apr 05 2020
STATUS
approved