Find the Serialized Integer
JavaScript (ES6), 40 37 bytes



f=(n,i=s='0')=&gt;(s+=++i)[n]?i-1:f(n,i)
&lt;input type=number min=1 value=1 oninput=o.textContent=f(this.value)&gt;&lt;pre id=o&gt;0




Edit: Saved 3 bytes with some help from @Arnauld.