This is an exercise from Carothers Real Analysis: Let $p \geq 2$ an integer. "Count" the real numbers in $(0,1)$ that have an eventually repeating base $p$ decimal expansion.
For example, let $p=9$.
This is what I have tried:
First, we count real numbers eventually ending with repeating 8's. This is easy because these numbers are just numbers with finite decimal expansion. Such as $0.49999999999... = 0.5$. So these numbers are just rational numbers, they are countable.
But how to deal with numbers ending with other digits? Like $0.4777777777777$? How to count them?
Based on the comments, here is a useful link