OFFSET
0,2
COMMENTS
EXAMPLE
a(3) = 21 because 3 = "10" (in base 3) becomes "21".
a(8) = 0 because 8 = "22" (in base 3) becomes "00".
MATHEMATICA
Table[FromDigits[IntegerDigits[n, 3]/.{0->1, 1->2, 2->0}], {n, 0, 60}] (* Harvey P. Dale, Jun 17 2022 *)
PROG
(PARI) A256303(n, b=3)=!n+eval(Strchr(apply(d->(d+1)%b+48, digits(n, b))))
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
M. F. Hasler, Mar 22 2015
STATUS
approved