OFFSET
0,4
COMMENTS
Every integer appears once in the sequence.
LINKS
Rémy Sigrist, Table of n, a(n) for n = 0..6561
EXAMPLE
For n = 5, the base-3 expansion of 5 is "12", so the base-3 expansion of A362089(5) is "102", and a(5) = -2^2 + 2^0 = -3.
PROG
(PARI) a(n) = { if (n==0, 0, n%3, 4*a(n\3) + (-1)^(n%3), 2*a(n/3)); }
(Python)
from gmpy2 import digits
def A362090(n): return sum((-(1<<i) if int(j)&1 else 1<<i) for i, j in enumerate(digits(n, 3).replace('1', '01').replace('2', '02')[::-1]) if j!='0') # Chai Wah Wu, Apr 12 2023
CROSSREFS
KEYWORD
sign,base
AUTHOR
Rémy Sigrist, Apr 08 2023
STATUS
approved