Find all two-digits $N$ for which the sum of the digits of $10^N-N$ is divisible by $170$. My friend was surfing on the web for Math Questions. He found a Math Question:

Find all two-digits $N$ for which the sum of the digits of $10^N-N$ is divisible by $170$.

I tried it, and this is my attempt.
$10^N-N=(10^N-1)-(N-1)=999...999-(N-1)$
The digit sum of $(10^N-N)=9N-$ the digits sum of $(N-1)$
Then I am stuck.
Can someone help me? Any help is appreciated!
 A: The digit sum of $N-1$ is somewhere between $1$ and $17$ (inclusive). So our two-digit number must necessarily be such that $9N$ is within "reach" of a multiple of $170$. The possible values for $9N$ and thus $N$ is therefore
$$
\begin{array}{|c|c|c|}
\hline 9N & N & \text{Digit sum}\\
\hline 171&19 & 9\\
\hline 180&20 & 10\\
\hline 342&38 & 10\\
\hline 351&39 & 11\\
\hline 513&57 & 11\\
\hline 522&58 & 12\\
\hline 684&76 & 12\\
\hline 693&77 & 13\\
\hline 855&95 & 13\\
\hline 864&96 & 14\\
\hline
\end{array}
$$
We see that the $N$ for which $9N$ minus the digit sum of $N-1$ is a multiple of $170$ are the larger one in each "pair", which is to say
$$
20, 39, 58, 77, 96
$$
A: Since the digit sum of a $2$ digit number is between $1$ and $18$, this narrows down the possible set of values which $9N$ can have for the result to be a multiple of $170$. Thus, there are not too many cases to check to see which one(s) might work. First, starting with $N = 19$, you get $171 - 9 = 16$, with $N = 20$, you get $180 - 10 = 170$, so this works, and the rest are too large. Next, for around $340$, $N = 38$ gives $342 - 10 = 332$, $N = 39$ gives $351 - 11 = 340$, so this one works, and higher ones don't. Next, for around $510$, $N = 57$ gives $513 - 11 = 502$, $N = 58$ gives $522 - 12 = 510$, so this also works, and the rest are too large. You may see a pattern here of each $19$ value larger working, so the next ones are $77$ and $96$, which you can confirm. In summary, this gives $20, 39, 58, 77, 96$ as the only values.
To do this more analytically instead, let $N = 10a + b$ where $1 \le a \le 9$ and $0 \le b \le 9$. Then, as you have already determined, $9N = 90a + 9b$. If $b \gt 0$, then the digit sum of $N - 1$ is $a + b - 1$. Thus, the overall digits sum is
$$90a + 9b - (a + b - 1) = 89a + 9b - 1 \tag{1}\label{eq1}$$
Alternatively, if $b = 0$, then the digits sum of $N - 1$ is $(a - 1) + 9 = a + 8$, giving an overall digits sum of
$$90a - (a + 8) = 89a - 8 \tag{2}\label{eq2}$$
Next, you can then check each integral multiple of $170$ to see which value(s) of $a$ and $b$ work. For example, with \eqref{eq1}, you have
$$89a + 9b = 171 \tag{3}\label{eq3}$$
Only $a = 2$ possibly works here, but that would give $9b = 7$, so it fails. Instead, checking with \eqref{eq2} gives $89a - 8 = 170 \implies a = 2$. Thus, as found before, $a = 2, b = 0$, i.e., $20$, works. You can do the same sort of checking for the rest of the multiples of $170$.
