The challenges of additive persistence ------------------------------------
If you still remember casting out nines from your school days, you have probably already calculated additive persistence without realizing it. The game is simple: take an integer n, add its digits, then repeat until you obtain a single-digit number. The number of steps required is the additive persistence of n. For example, starting with 199 gives the following sequence: 19919101199 \to 19 \to 10 \to 1. The additive persistence of 199 is 3.
If you write the digit 1 one hundred and ninety-nine times, you will obtain a number with additive persistence 4. By repeating this trick, you can obtain a number with arbitrarily large additive persistence. This raises a minimization question: what is the smallest number with a given additive persistence? For persistences 1, 2 and 3, the values are 10, 19 and 199. Noting that 199 = 1 + 22 × 9 establishes that the additive persistence of 19,999,999,999,999,999,999,999 is 4, and this is the smallest number with that property. We leave you to find the smallest integer with additive persistence 5!