Which is the fastest way to solve these two problem? I have two problems which are based on the sequence $A007376$.


*

*Natural numbers starting with $1$ are written one after another like $123456789101112131415\cdots$, how could we find the $10^4$th digit from left?

*A hundred digit number is formed by writing the first $x$ natural numbers one after another
as $123456789101112131415\cdots$, how to find the remainder when this number is divided by $8$?


The OEIS doesn't provide any formula that could be implemented into a under a minute solution,as this is a quantitative aptitude problem, I was wondering which is the fastest way to approach?
 A: There are $9$ one-digit numbers, giving the first $9$ digits. 
Then there are $90$ two-digit numbers, giving the next $180$ digits; total, $189$ digits, so far. 
There are $900$ three-digit numbers, giving $2700$ digits, total $2889$. 
To get to $ 10,000$, you need another $7111$, which is $7108/4=1777$ four-digit numbers, and the first $3$ digits of the $1778$th four-digit number. You should be able to figure out what those are. 
For the hundred digit number, same process, then remember that the remainder on division by $8$ depends only on the last $3$ digits. 
A: 10^4 = 10000
so we have to find out the 10000th digit of the sequence. 
As we know there are 9 one-digit numbers, which will give first 9 digits.
Then there are 90 two-digit numbers from 10 to 99, which will give the next 180 digits; 
There are 900 three-digit numbers from 100 to 999, which will give the next 2700 digits, 
Total number of digits = 9+90*2+900*3 = 2889
To get to 10000, we need another 10000 - 2889 =7111 digits,  Now all the numbers of sequence will be of 4 digits so number of such number = [ 7111/4] + 1 = 1777 + 1 = 1778 
as 7111 = 1777*4 + 3
so we will take only first three digits of 1778. which is 177
so 10000th digit = 7
2nd ) in case of 100 digit number in the above sequence , 100th digit
first 9 = 1 to 9
remaining 100-9= 91 will be from two digit numbers
91 = 45*2 +1
So it will be 46th 2nd digit number which is 46+9 = 55
So last three digit number will be 545
Reminder 9545/8) = 1
