I came across a riddle and I wanted to do know if I solved it correctly:
If we write every natural number next to each other: Example: $012345678910111213\cdots$ What is the digit at position $10000$?
My attempt: Left side is the amount numbers and right side is the digit size of the number: $$10 \qquad 1$$ $$90 \qquad 2$$ $$900\qquad 3$$ $$1777.5\qquad 4$$
Now we have $10000=10\cdot 1 + 90\cdot 2+900 \cdot 3+1777.5 \cdot4$
So it should be the second or third digit of $999+1778=2777$
is this correct? And is it possible to write a closed formula to get a specific position?