Relation $S(2x)=2S(x)-9N(x)$. Let $S(x)$ be the sum of digits of number $x$ and $N(x)$ be the number of digits of $x$  greater than $4$. Prove that $S(2x)=2S(x)-9N(x)$.
For example, if $x=1992$ then $S(x)=1+9+9+2=21$ and $S(2x)=3+9+8+4=24$ and $N(x)=1+1=2$. Hence $24=2\times 21-9\times 2$.
Can anyone show its full solution? Unfortunately I have no idea.
 A: Let $l(x)$ be the length of the decimal representation of $x$. Use induction on $l(x)$. Suppose the identity holds for $l(x)\le n$. 
Let $x=10y+r$ where $l(y)=n$ and $r\in\{0,1,\cdots,9\}$. $S(10z)=z\;\forall\;z$.

If $r<5\implies N(x)=N(y)$

$$
S(2x)=S(20y+2r)=S(20y)+2r=S(2y)+2r\\
=2S(y)-9N(y)+2r=2S(10y)-9N(x)+2r\\
=2S(10y+r)-9N(x)=2S(x)-9N(x)
$$

If $r\ge5\implies N(x)=N(y)+1$ 

$$
S(2x)=S(20y+2r)=S(20y)+2r-9=S(2y)+2r-9\\
=2S(y)-9N(y)+2r-9=2S(10y)+2r-9N(x)\\
=2S(10y+r)-9N(x)=2S(x)-9N(x)
$$
A: Keeping in mind that the number of digits greater than $4$ is $N(x)$, we can look at $S(2x)$. Let the number of digits of $x$ be $n$. Then the number of digits less than or equal to $4$ is $n-N(x)$, and those digits multiplied by $2$ are less than $10$, so the sum of these digits of $2x$ is simply twice the sum of these digits of $x$. If a digit is greater than $4$, then what happens with the sum of the digits when we multiply by $2$? We see that, given a digit $d>4$, we know that, when we sum the digits of $2x$, the digit $2d$ (which is not actually a single digit, but that's not a problem since we compute the sum of the two digits that result from $2d$) is $2d-10$ for the last digit and $1$ for the first, so the sum is $2d-9$. Thus, since there are $N(x)$ such digits $d$, we have $$S(2x)=2S(x)-9N(x)$$
I realize that my arguments may a bit vague to some people, so if you're having trouble understanding my answer, leave a comment with what part you find difficult to understand, and I'll be very glad to edit my answer so that it may be clearer.
Hope this helped!
