How many times does digit 5 appear? Odd numbers are consecutively written $1,3,5,7,9,...,999999$. How many times does digit $5$ appear?
I have attempted to form the following strings by adding $0s$:
$000001$
$000003$
$000005$
$...$
$999999$
 But can't go any further.
 A: For given $r\geq1$ consider the list  of all odd natural numbers between $0$ and $10^r$.
There are $n:={1\over2}\cdot 10^r$ numbers in this list. At each of the first $r-1$ decimal places ${1\over10}$ of all $n$ numbers have the digit $5$, and at the last decimal place ${1\over5}$ of all $n$ numbers have the digit $5$. The total number $N_r$ of appearances of a $5$ in this list is therefore given by
$$N_r=(r-1)\cdot{n\over10}+{n\over5}={(r+1)n\over10}={r+1\over2}\cdot10^{r-1}\ .$$
In particular $N_6=350\,000$.
A: HINT: the digit $5$ appears 1) as the last digit  on the right, one time for each progressive sequence of $10$ units; 2) as the second to last digit on the right, $10$ times for each progressive sequence of $100$ units; 3) as the third to last digit on the right, $100$ times for each progressive sequence of $1000$ units; and so on.
A: Totally you will get 3 lakhs of 5s in all off numbers from 1 to 999999.
when you consider all odd digits from 1 to 100, in one's place you will get 10 5s. So in 1 to 999999, you will have
10*1000000/100 number of 5s in one's place.simillarly consider for 10s,100s,1000s,10000s,100000s place add all these you will get 100000+50000+50000+50000+50000,which is equal to  300000
A: First count how many numbers contain exactly one 5. The 5 can be in any of the six digit-places, and each of the other five digit-places can be 1, 3, 7, or 9. Hence there are $6\cdot4^5$ numbers containing exactly one 5.
Now count how many contain exactly two 5s. There are $^6\mathrm C_2$ choices of digit-places for the two 5s, and each of the other four places can be 1, 3, 7, or 9. Hence there are $^6\mathrm C_2\cdot4^4$ such numbers, and 5 occurs $2\cdot^6\mathrm C_2\cdot4^4$ among them.
Continuing in this way, we find that the number of times 5 occurs is
$$\sum_{r=1}^6\,r\cdot^6\mathrm C_r\cdot4^{6-r}$$
