I have following expression: $\left\lfloor\frac{n}{10}\right\rfloor+\left\lfloor\frac{n}{10^2}\right\rfloor+\left\lfloor\frac{n}{10^3}\right\rfloor+\ldots+\left\lfloor\frac{n}{10^{\lfloor\log_{10} n\rfloor}}\right\rfloor$ where $n$ is a positive integer, greater than $0$
Can this expressoin be somehow simplified? If yes - how?
Thank you
Consider the decimal expansion of $n$. The first term is obtained from $n$ by deleting the rightmost digit, the second by deleting the rightmost $2$ etc., while the last term is just the leftmost digit. For example, with $n=123$ your sum is $12+1=13$.
Write $n=\sum_{i=0}^k a_i 10^i$, with integer coefficients $0\le a_i\le 9,\,a_k\ne 0$. The desired sum is $$\sum_{j=1}^k\sum_{i=j}^k a_i 10^{i-j}=\sum_{i=0}^k a_i(\sum_{j=1}^i 10^{i-j})=\sum_{i=0}^k a_i\tfrac{10^i - 1}{9}=\tfrac{n-\sum_i a_i}{9}.$$Note that $\sum_i a_i$ is the sum of digits of $n$.