Sum of digits $S(n)$

190 Views Asked by At

Let $S(n)$ be sum of digits of the number $n\in\mathbb{N}$. For example, $S(15)=1+5=6, S(92)=9+2=11$. Then find the minimum value of $\frac{n}{S(n)}$ for $n$ is in

$1. [10, 99]\\ 2. [100,999]\\ 3. [1000,9999]\\ 4. [10000,99999]\\ 5. [100000,999999]$

My idea is, let $a,b$ are integers in $[0,9]$. If $a\neq 0$, we have $9a\geq b$

For $10\leq n\leq 99$, we can express $n=10a+b$. Then $$\frac{10a+b}{a+b}=1+\frac{9a}{a+b}\geq 1+\frac{9a}{a+9a}=\frac{19}{10}$$ Equality occurs $9a=b\implies n=19$

For $100\leq n\leq 999$, we can express $n=100a+10b+c$. Then $$\frac{100a+10b+c}{a+b+c}=1+9\cdot\frac{11a+b}{a+b+c}\geq 1+9\cdot\frac{11a+b}{a+b+9a}=1+9\cdot\frac{11a+b}{10a+b}=10+9\cdot\frac{a}{10a+b}\geq 10+9\cdot\frac{a}{10a+9a}=10+9\cdot\frac{1}{19}=\frac{199}{19}$$ Equality occurs $9a=b=c\implies n=199$.

But for $1000\leq n\leq 9999$, we can express $n=1000a+100b+10c+d$. Then $$\frac{1000a+100b+10c+d}{a+b+c+d}=1+9\cdot\frac{111a+11b+c}{a+b+c+d}\geq 1+9\cdot\frac{111a+11b+c}{a+b+c+9a}=1+9\cdot\frac{111a+11b+c}{10a+b+c}=10+9\cdot\frac{101a+10b}{10a+b+c}\geq10+9\cdot\frac{101a+10b}{10a+b+9a}=10+9\cdot\frac{101a+10b}{19a+b}=100-9\cdot\frac{89a}{19a+b}$$ and if we use $b\leq 9a$, $$100-9\cdot\frac{89a}{19a+b}\leq 100-9\cdot\frac{89a}{19a+9a}=71\frac{11}{28}$$ which is not minimum value(increased). Can anyone help me?

1

There are 1 best solutions below

0
On

Consider a $k$ digit number $n$ with $3\leq k\leq 11$.

Then $10^k > n\geq 10^{k-1}$ and $100>9k \geq S(n)\geq 1$, so that $10^k >\frac{n}{S(n)}>10^{k-3}$.

Increasing $l$th digit by 1 means adding $10^{k-l}$ to the nominator and $1$ to denominator, which decreases the fractions which are bigger than $10^{k-l}$. So when $n$ minimizes $n/S(n)$, all the digits starting from the third should be increased as much as possible, making them $9$s.

Then this means $S(n)\geq 10$ so $\frac{n}{S(n)}<10^{k-1}$ and by the same logic the first digit should be minimized making it $1$. Thus the optimal $n$ is of the form $1d99...9$, and $n/S(n)$ is $(10^{k-1}+(d+1)10^{k-2}-1)/(9(k-2)+(d+1))$.

The question of wether $d$ has to be increased or decreased boils down to comparing this fraction with $10^{k-2}$, or to comparing $10-\epsilon$ (where $\epsilon<1$) with $9(k-2)$, so for $k=3$ we should maximize $d$, getting $n=199$, and for $k>3$ we minimize it, to get $n=109...9$.