1

I must find 'x' and I don't know how to solve the following equation.
Does it have a solution? How can I solve it?

$$ S=\left(\lfloor\log_{10}(x)\rfloor+1\right)x - \frac{10^{\lfloor\log_{10}(x)\rfloor+1}-10}{9} $$

$$S,x\in\mathbb N$$

Carlos
  • 11

2 Answers2

0

If you could solve it by reasoning, here is my opinion.

If you can observe, the first part of S has and depends on log x to be a natural no. and the other one has (x-1)/9 as a term. Since both S and x are natural numbers, x can only be 1,10,100, 1000...

Rohinb97
  • 1,702
0

For an integer $k\ge 0$, if $10^k \le x < 10^{k+1}$, then $\lfloor \log_{10}x\rfloor = k$ so $$ S(x) = (k+1)x -\frac{10^{k+1}-10}{9}=(k+1)x-\frac{10}{9}(10^k-1) $$ So, for example, if $1\le x \le 9$, then $S(x) = x$. If $10\le x \le 99$, then $S=2x-10$. If $100\le x\le 999$, then $S=3x-110$, and so on.

The first few $S$ values are $$ \begin{array} &x = & 1 & 2 &\dots & 9 & 10 & 11 & 12 & \dots & 99 & 100 & 101 & 102 & \dots 999\\ S = & 1 & 2 &\dots & 9 & 10 & 12 & 14 & \dots & 188 & 190 & 193 & 196 & \dots 2887\\ \end{array} $$

Rick Decker
  • 8,718