# How many times does $3$ appear in the $\{3,6,9,\ldots,1002\}$?

A set $S$ is defined as $S = \{3,6,9,\ldots,1002\}.$
How many times does digit three appear in the decimal representations of members of $S$?

I have solved this question by seeing pattern like $3, 6, 9$, but is there a general solution?

-
by general solution, you mean for like any digit? for any range for the set? –  mathguy Aug 18 '12 at 16:22
yes for any digit –  Arpit Bajpai Aug 19 '12 at 3:54

Hint: how many numbers are in the set? How many 3's appear in the units place? In the tens place?

-
ps. For the Set $\{3,6,..., 10^n-1 \}$ on each place we have $[\frac{10^n}{3}]+1$ digits "3". So we have total $n \cdot \left([\frac{10^n}{3}] +1) \right)$ digits "3".