Base 8:

1, 2, 3, 4, 5, 6, 7,

10, 11, 12, 13, 14, 15, 16, 17,

20, 21...

As you can see, in the ones place you have a 3 every time the 8s place (10s place in base 8) changes.

The 8s place changes from 0, to 1, ...to 7 and back to 0 when the 64 place (100 place in base 8) changes.

So you have 8 3s per 100 (64) and 8^2 per 1000 (512).

Do something similar to find how many 3s in the 8s place and 64 place.

Pretty much just how you would do it in base 10, except use 8 whenever you would normally use 10.