JavaScript (ES6), 47 4343 42 bytes
-4 bytes thanks to @Arnauld
-1 byte thanks to @Luke
n=>eval('for(i=0;!/^9+0*$/.test(i+=ni););i'i+=n')
Tests
let f=
n=>eval('for(i=0;!/^9+0*$/.test(i+=ni););i'i+=n')
for(let i=1;i<=16;i++)console.log(`f(${i}) = `+f(i))
Recursive solution (fails for 7, 13, and 14), 38 bytes
n=>g=(i=0)=>/^9+0*$/.test(i+=n)?i:g(i)
Called like f(5)()
. Reaches the max call stack size in Chrome and Firefox for n=7
, n=13
, and n=14
.
f=
n=>g=(i=0)=>/^9+0*$/.test(i+=n)?i:g(i)
for(let i=1;i<=16;i++){
try { console.log(`f(${i}) = `+f(i)()) }
catch(e) { console.log(`f(${i}) = FAILED`) }
}