OFFSET
0,2
COMMENTS
LINKS
PROG
(PARI) a(n) = my (t=Vecrev(digits(n, 3))); sum(i=0, #t-1, if (t[i+1]==1, 2, t[i+1]==2, 1, 0) * 3 ^ a(i))
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Mar 17 2018
STATUS
approved