We want to reach a number with at least a digit zero. To do so, we'll show that for large enough numbers the first digits can't increase too much.
In particular, assume $a_n$ has $d$ digits, so that $P(a_n)\leq 9^d<10^{d-1}$ for $d$ big enough (see later). Therefore the first digit of $a_{n+1}$ changes by at most one, and in particular when we arrive at the first digit being $9$, we can't increase the length of the number and directly pass to the first two digits being $11$ without first passing through $10$. When we reach this point (if not, we will have to stop before) the sequence will be constant, since $P(a_n)=0$.
The inequality only works if $9^d<10^{d-1}$, which works from $d>d_0=\log_{10/9}(10)=21.85...$. Finally we see that $10^{d_0}<10^{22}<(10^3)^8<(2^{10})^8=2^{80}<2^{2018}$, so we are done