Find nth number which does not contain the digit c
Let's do it in base 3.
Here are the first 8 numbers without 2 (left column) and the first 8 numbers without 1 (right column), with zero padding:
000    000
001    002
010    020
011    022
100    200
101    202
110    220
111    222

Hopefully you can take it from here.