OFFSET
0,2
COMMENTS
EXAMPLE
a(3) = 7 because 3 = 10[3] becomes 21[3] = 7.
a(8) = 0 because 8 = 22[3] becomes 00[3] = 0.
MATHEMATICA
Table[FromDigits[IntegerDigits[n, 3]/.{0->1, 1->2, 2->0}, 3], {n, 0, 100}] (* Harvey P. Dale, Jan 21 2019 *)
PROG
(PARI) A256293(n, b=3)=!n+apply(t->(t+1)%b, n=digits(n, b))*vector(#n, i, b^(#n-i))~
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
M. F. Hasler, Mar 22 2015
STATUS
approved