How many $5$-digit numbers less than $43205$ do not contain any digits greater than $6$? I'm not sure how to solve this question.
The only starting point I've thought of is $3 \times 7^4$ because one case would involve the first digit being either $1, 2$ or $3$, and the remaining $4$ digits would each have $7$ number possibilities.
Would someone be able to explain how to approach this question please?
 A: The total number of positive integers that are less than $43025$ using only digits between 0 and 6 is that same sequence of digits, interpreted as a base 7 number.
$$N_{tot} = 43025_7   $$
but $7^4 = 10000_7$ of these will have a leading digit of zero and so do not qualify as 5 digit numbers.
so
$$ N_{5 \text{ digits }}= 43025_7 - 10000_7= 33025_7   $$
It is interesting to note that the answer is the same no matter what base the question is posed in (as long as the base is 7 or greater)
For instance,  the number of 5 digit hexadecimal numbers that are less than $43025_{16}$ and that can be made using only digits between 0 and 6 is also $33025_7$
A: Your start is perfect.  There are $3\times 7^4$ $5$ digit numbers strictly less than $40000$ that do not contain a digit more than $6$.
So now count how many there are between $40000$ and $43205$.   If take the second digit can be $0,1,2$ there are $3\times 7^3$ such numbers between $40000$ and $42999$.
So now count how many there are between $43000$ and $43205$ and ... well, continue. If we take the third digit to be $0$ or $1$ there are $2\times 7^2$  numbers between $4300$ and $43199$.
Now we just need the numbers between $43200$ and $43205$ (exclusive) and there are clearly $5$ of those (as we want numbers strictly less than $43205$... so we want $43200, 43201,43202,43203$ and $43204$).
So there are  $3\times 7^4 + 3\times 7^3 + 2\times 7^2 + 5$.
....
But you know.... This is basically counting in base $7$.
Every $5$ digit base $7$ number between $10000_7$ through $43205_7$ will be listed.
And So there will be $43205_7 - 10000_7$ such numbers.
And that is $43205_7 - 10000_7 (4\times 7^4 + 3\times 7^3 + 2\times 7^2 + 0 \times 7 + 5\times 7^0 ) - 7^4  = 3\times 7^4 + 3\times 7^3 + 2\times 7^2 + 5=33205_7$
.....
This basically demonstrates why we can express numbers in a decimal base.
A: You got off to a good start with $3\times7^4$.  Add $3\times7^3+2\times 7^2+5$
