S(n) properties

72 Views Asked by At

Recently, while reading a number theory textbook for Olympiads, i came across the following property;

$S(n_1+n_2) \le S(n_1) + S(n_2)$

Where S(A) is the sum of digits of A in base 10. In my textbook, there was a proof given but i couldn't follow it at all.

So I am looking for a proof of the following property and hopefully some reasoning behind it.

Any help would be appreciated, thanks!

2

There are 2 best solutions below

2
On BEST ANSWER

Assume $$a = 10^0a_0 + 10^1a_1+10^2a_2+... \\ b = 10^0b_0 + 10^1b_1+10^2b_2+... $$then$$ S(a) = a_0+a_1+... \\ S(b) = b_0+b_1+... \\ \implies S(a)+S(b) = (a_0+b_0)+(a_1+b_1)+...$$ Also, $$a+b = 10^0(a_0+b_0) + 10^1(a_1+b_1)+... \\ a+b =:c = 10^0c_0 + 10^1c_1+10^2c_2+...$$ then $S(a+b) = c_0+c_1+...$

Now

  • if $a_k + b_k \ge 10$ for some $k$, then $c_k = a_k + b_k - 10 \le a_k + b_k$, but then $c_{k+1} = a_{k+1} + b_{k+1} + \color{red}1$. However this $\color{red}1$ cannot compensate $-10$ in the previous term. So, the inequality still holds overall.
  • else if $a_k + b_k < 10$ for some $k$ and the previous terms don't exceed $10$ (as the above case), then $c_k = a_k + b_k$. But if the previous terms do exceed, then by the same argument above, the inequality still holds.

Therefore, $$c_0 + c_1 +... \le (a_0+b_0)+(a_1+b_1)+... $$ or $$S(a+b) \le S(a) + S(b)$$ as desired.

0
On

When you add two numbers, the sum of two facing digits is preserved, unless there is a carry. In this case, the sum is diminished by $9$.

$$\begin{align}\\1234\\+5678\\\hline6912 \end{align}$$

$$4+8\to 2+1,\\3+7\to 0+1,\\2+6\to8,\\1+5\to6.$$