I want to check how many integral numbers in $\big[1,10^6\big]$ include the numbers $1,2,3,4,5$ and how many only them.
how should I check it? this is a problem of inclusion-exclusion?
I would like to get some advice!
Exclude $10^6$, and consider $[0,999999]$.
For your first question:
There are $10^6$ numbers in the interval $[0,999999]$. Each number in this interval can be thought of as having $6$ digits (So, $27$ would be $000027$). The numbers that do not satisfy the given property are entirely composed of $0,6,7,8,9$. So the total number of numbers to be excluded are $5^6$.
For your second question:
There are exactly $5$ one-digit numbers that satisfy this property. Similarly, there are $5^2$ two-digit numbers with this property. Continue and then sum all the numbers.
Make sure to consider $10^6$ in the end.