This question already has an answer here:
- Find the number in the Champernowne constant 28 answers
Inspired by this question.
Champernowne's constant is an infinite decimal number that consists of "0." followed by all natural numbers concatenated together. It begins like so:
0.123456781011121314151617181920212223242526272829303132333435363738394041424344454647484950, etc. The digits of Chamernowne's constant are sequence A033307 in the OEIS.
Write a program or function that, when given an integer as input, outputs/returns Champernowne's constant up to the first occurance of the input. For example, if the input is
13, you should output
0.12345678910111213. If you wish, for inputs greater than 0, you may drop the leading "0." in your output.
An integer, or a string containing only numbers.
Champernowne's constant up to the first occurance of the input.
0 -> 0 1 -> 0.1 OR 1 14 -> 0.1234567891011121314 OR 1234567891011121314 91 -> 0.1234567891 OR 1234567891 12 -> 0.12 OR 12 101 -> 0.123456789101 OR 123456789101
This is code-golf, lowest score in bytes wins!